I have a stored procedure that allows users to pass in parameters.
SELECT *
FROM Table1
WHERE columnA =@paramA, ColumnB=@paramB....
I need to hide the results if there are less than 10 rows, but return them if there are more than 10. Is there a clean way to do this? Any help would be great.
Best Answer
You can use
count(*) over()
to make sure your result set has that many rows.You didn't say what to do if the rows = 10, only > or <, so you may need to change the operand to >= based on what you want.
DB FIDDLE