SQL 50, decoded
0 of 50 solved/50

1683. Invalid Tweets

SQL 50 · Select (day 1). Decode it with the hints, solve it on LeetCode, then compare with the reference solution in MySQLPostgreSQL.

EasySolve it on LeetCode ↗

Your work

Hints

Open one at a time. Try to finish with as few as you can.

1. What does one output row represent?
One tweet.
2. Approach
WHERE CHAR_LENGTH(content) > 15.
3. The trap
LENGTH counts bytes in MySQL, CHAR_LENGTH counts characters.In PostgreSQL LENGTH and CHAR_LENGTH both count characters; OCTET_LENGTH counts bytes.

Reference solution

Tested on MySQL 8.0 and PostgreSQL 16. Switch dialect at the top of the page.

Show the MySQLPostgreSQL solution
SELECT tweet_id
FROM Tweets
WHERE CHAR_LENGTH(content) > 15;