Skip to content

Tag: mysql

Get a count of individual instances of a value in MySQL

I have a table with two fields, inbound and outbound, both of which are text values. I want to get all a count of all instances of a specific value in either or both of those columns. Here’s an example of the schema with some values and my query: Here’s an SQL fiddle with the schema and my current…

SQL Query to find top 5 cumulative tweets

How to find the top 5 months with the highest number of cumulative tweets and sort it according to the number of tweets of each month. Table twitter structure is like this: Token type Month …

multidimensional “WHERE IN” condition?

As is well-known, we can simplify as follows: Is there a similar shortcut possible for “multidimensional” conditions as in the following: in a form resembling something like this ? I would be willing to count anything as a simplification that uses O(n) characters where the factor is significantly …