You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DECLARE @value AS VARCHAR(100) = 'thing';
SELECT * FROM table WHERE col = @value
Unpivot
WITH selection AS (SELECT idx, a1, a2, a3 FROM table)
SELECT m.idx, m.letter, m.attribute, m.value
FROM selection
UNPIVOT (value FOR attribute IN (a1, a2, a3)) AS m
WITH expressions
-- This
WITH b as (SELECT*FROM t)
SELECT x, y, z
FROM a INNER JOIN b
ONa.id=b.id-- Is the same as thisSELECT x, y, z
FROM a
INNER JOIN (SELECT*FROM t) b
ONa.id=b.id