Skip to content

Tag: tsql

Using PIVOT to get SELECT into one column, not row

I am trying to make a select, which would show the result into ONE column, not row. I tried using PIVOT, but I am not successful at all. Result of my select: I want to have it like this: Answer You can use cross apply to obtain a single column: results: or, if you prefer having a separate column for

Use smaller than on like clause

I have some number like These numbers are only an example I have a lot of 14… a lot of 15… etc. Now in WHERE clause of a stored procedure, I want to exclude all numbers who start with 15 or less so I can do something like: Is there a way to change this and use something like TestColumn