Skip to content

SQL Get users with max occurrences in table

Given the following table transactions, which records the IDs of sellers and buyers who had a transaction, I would like to determine the user who was involved in the highest number of transactions and …

Add multiplicity as rows

I use Sparx EA to build a relationship database (MS SQL Server). The tool has a function to create charts. I use the query: SELECT system.Name AS Series, systemElement.Name AS GroupName FROM t_object …

Get next row with clause A since last row with clause B

I have the following table: I am looking for a way to get all customers whose status is currently not ‘ok’ with an indication since when the status is not ‘ok’. The result should be: My attempt is the following, but it gives incorrect values for customers that are currently ‘ok&#…

Scope_identity is giving null values? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I have stored procedure in which I use scope_identity() Error I get: cannot insert null into i…