Skip to content
Advertisement

Tag: group

SQL Server: show string majority

I am looking to make a query in SQL SERVER that will allow me to display in a grouping the string that appears in most cases. Not the amount, not the maximum, but the string that is displayed in most cases: colA colB colC A 10 ccc A 20 aaa A 35 bbb A 25 aaa A 10 aaa B

SQL Server : how to group only part of the syntax

I have a problem creating a SQL Server query. In summary, the query should get columns that are sum and count, grouped by customerID, and another column that is a case when by a column that is not used as a grouper column. My problem is to group only part of the syntax, while the case when column does not

SQL Query group by for a beginner

I’m quite new to SQL Server and was wondering if it was possible to run a query like this. I have a table with the following fields: USER, WORKSTATION, DURATION (seconds) Each USER can use multiple workstations and each workstation can be used by multiple USERs. In the table I have records like: I would like a result that groups

Advertisement