subtle "SQL" statements:
Copy table (copy structure only, source table name: A new table name: b)
Sql:select * into B from a where 1<>1
|
Copy table (copy data, source table name: A target table name: b)
Sql:insert into B (A, B, c) select d,e,f from B;
|
Show article, submitter, and last reply time
Sql:select a.title,a.username,b.adddate from Table A,
(select Max (adddate) adddate from table where Table.title=a.ti TLE) b
|
Description: Outer join query (table name 1:a table name 2:b)
Sql:select a.a, A.B, A.C, B.C, B.D, B.f from a left-out JOIN b on a.a =
B.C
|
Schedule five minutes Advance reminder
Sql:select * from schedule where DateDiff (' minute ', F start time, GETDATE ()) >5
|
Two related tables, deleting information that is already not in the secondary table in the primary table
SQL:
Delete from info where NOT exists
(SELECT * from Infobz where Info.infid=infobz.infid)
|
1 2 Next page > full text reading tips: Try "←→" button, turn the page more convenient Oh!