Skip to content
Advertisement

Tag: group-by

SQL count Occurency trouble

I’m pretty new in the SQL world and i have some troubles about counting some row. I explain myself: I have a DB like this: NAME | (somenumbers)| L1 | 2 L1 | 2 L2 | 3 L3 | 1 L3 | 1 L3 | 1 …

SQL sequent grouped rows

+——+——+——+————+ | id | room | type | created_at | +——+——+——+————+ | 8214*| 83 | msg* | 1571726466 | | 8213 | 83 | msg* | 1571724983 | | 8212 | 83 | ad …

How to use order by after group by sql

I have a table like this: and I need to group by and order on positionNr. I tried with this query: But I obtain something like this: But what I want is a result like this: Please can you help to understand where is the problem on the query? Answer Based on your expected result, it seems that: 1- You

Advertisement