Skip to content
Advertisement

Create frequent number sqlite queries

Good evening. I created a database with 9 columns and 605 rows. On column 3, 4, 5, 6, 7 there are numbers ranging from 1 to 90 random. Now I would like to create a query that tells me on each line how many times a number is frequent. The table is divided into 11 lines: Bari, Cagliari etc. For each city I have to count how many times a number has come out.

I await your response. Thanks.

Link a image: enter link description here

Advertisement

Answer

When you post SQL questions, it often helps to tell us what database system you’re using, because the syntax is often slightly different between systems.

However, here is a query which (I think) does what you expect for most systems. You might have to tweak it.

I generated it with Rasgo automatically and then tested it in Snowflake.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement