Skip to content

Instantly share code, notes, and snippets.

@AngryLionAman
Created July 26, 2019 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AngryLionAman/2e2df5e07d2bc62414f8768995f046f8 to your computer and use it in GitHub Desktop.
Save AngryLionAman/2e2df5e07d2bc62414f8768995f046f8 to your computer and use it in GitHub Desktop.
mysql> select t.unique_id, t.topic_name,count(distinct user_or_followers_id)as totalFollowers from topic t left join topic_followers_detail tf on tf.topic_id - t.unique_id group by 1 limit 20;
+-----------+--------------------------+----------------+
| unique_id | topic_name | totalFollowers |
+-----------+--------------------------+----------------+
| 255 | Engineering | 53 |
| 256 | decision making | 58 |
| 257 | career decision | 55 |
| 258 | rahul gandhi | 57 |
| 259 | politician | 58 |
| 260 | congress party | 58 |
| 261 | surgical strike | 58 |
| 262 | air strike | 58 |
| 263 | strike | 58 |
| 264 | indian air force | 57 |
| 265 | java | 57 |
| 266 | programming | 58 |
| 267 | jsp | 58 |
| 268 | php | 58 |
| 269 | Html | 58 |
| 270 | ????? ???? ????? ???? ?? | 58 |
| 271 | village | 58 |
| 272 | city | 58 |
| 273 | thinking | 58 |
| 274 | living | 58 |
+-----------+--------------------------+----------------+
20 rows in set (0.41 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment