не могли бы вы помочь?
SELECT (some columns), SortOrder = CASE WHEN City = @inParamCity THEN 0 ELSE 1 END FROM dbo.addressBook ORDER BY SortOrder
Я попробовал это и получил:
Incorrect syntax near '=' ' –
SELECT (some columns) FROM dbo.addressBook ORDER BY CASE WHEN City = @inParamCity THEN 0 ELSE 1 END
Не должно ли быть так?
SELECT (some columns), CASE City WHEN @inParamCity THEN 0 ELSE 1 END As SortOrder FROM dbo.addressBook ORDER BY SortOrder