What are the differences between the SET
and SELECT
statements when assigning variables in T-SQL?
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
Quote, which summarizes from this article:
When writing queries, this difference should be kept in mind :
I believe
SET
is ANSI standard whereas theSELECT
is not. Also note the different behavior ofSET
vs.SELECT
in the example below when a value is not found.