Sql case when multiple rows

A join would be the best solution here. Create a table that contains a list of categories and which products are associated with them, something. CASE in SQL Server is not a flow control statement (it's different than the switch statement in C#) - it's just used to return one of several possible. THIS QUESTION IS FOR SQL SERVER R2 My problem here is, I am writing a case statement and it is returning multiple rows instead of.

The CASE expression is one of my favorite constructs in T-SQL. .. Stack Overflow: CHECKSUM(NewId()) executes multiple times per row. Find out how to return multiple values in the THEN clause in a SQL CASE statement with this Read this tip from SQL expert Rudy Limeback on how to return multiple values in Using LEFT OUTER JOIN query to get zero row counts in SQL. You want to "collapse" multiple rows into one - that's a GROUP BY. What you want to GROUP BY are all the fields except for the CASE statement you are using .

How to return multiple values for THEN clause in an SQL CASE expression ODCIVARCHAR2LIST('Sent') 1 row selected. SQL> / OPTIONS. I am using a case statement to achieve this. However, I am getting multiple rows for the test scores for individual student. Is there any way to. Multiple row subquery returns one or more rows to the outer SQL statement. You may use the IN, ANY, or ALL operator in outer query to handle. CASE expressions can be used anywhere in a SQL statement an expression is allowed. It tests one expression against multiple values, this makes it great for.