+++++++++++++++++++++++++++++++++++++++++++
Variables for 1.t_sql
Find the age according to the date of birth, Datadiff (Yy,birth,getdate ())
Declares table type declare @mytable table (name varchar (), no int)
Assignment value:
Insert @mytable Select ' Mayun ', union
Select ' Bier ', 32
Table insertion table INSERT INTO phone select *from @mytable
++++++++++++++++++++++++++++++++++++++++++++++++++++
2. Go can be used as a variable scope limit
operator: Set @no =100%5,/* + -
print ' In time ' +convert (varchar), @unit) for something to output
= > < comparison operator
While @loop <=100
Begin
Set @loop +=1
End
+++++++++++++++++++++
Count (case when workstate= ' sick leave ' then 0 end) as ' sick leave '
The 0 here is only the sign, the whole is all equal to 0 of all statistics, calculate a quantity,
SQL review and new 2 advanced programming