SELECT:
Just selects data from a table, and does not change the values in the actual table.
so you see a view of the data.
select * from table1
see all data is table1
select * from table1
order by col01
see all data in table1 with the data ordered by col01.
so your view is different to the actual table but the table is unchanged.
SET:
this is used to change values in tables etc.
example 1:
update table1
set col01 = '23' where col01 = '21'
So set all instances of col01 to value '23' where it currently = '21'
example 2:
declare @variable as int
set @variable = '123'
create a variable called @variable and store value '123' in it.
Comment