纷纭教育
您的当前位置:首页力扣高频SQL 50题(基础版)第五题之1683. 无效的推文

力扣高频SQL 50题(基础版)第五题之1683. 无效的推文

来源:纷纭教育

力扣高频SQL 50题(基础版)第五题

1683. 无效的推文

题目说明:

表:Tweets

±---------------±--------+

| Column Name | Type |

±---------------±--------+

| tweet_id | int |

| content | varchar |

±---------------±--------+

在 SQL 中,tweet_id 是这个表的主键。

这个表包含某社交媒体 App 中所有的推文。

查询所有无效推文的编号(ID)当推文内容中的字符数严格大于 15 时,该推文是无效的

任意顺序返回结果表。

思路分析:

实现过程:

准备数据
Create table If Not Exists Tweets(tweet_id int, content varchar(50))
Truncate table Tweets
insert into Tweets (tweet_id, content) values ('1', 'Vote for Biden')
insert into Tweets (tweet_id, content) values ('2', 'Let us make America great again!')
实现方式
select tweet_id from Tweets where length(content)>15;
结果截图:

因篇幅问题不能全部显示,请点此查看更多更全内容