Note: copy a table (copy only structure, source table name: a new table name: B) SQL: select * distinct bfromawhere11 description: copy a table (copy data, source table name: a target table name: B) SQL: insertintob (a, B, c) selectd, e, ffromb; description: displays articles, submissions, and last response time SQL: selecta. title,. username, B. add description: copy a table (only copy structure, source table name: a new table name: B)
SQL: select * into B from a where 1 <> 1
Description: copy a table (copy data, source table name: a target table name: B)
SQL: insert into B (a, B, c) select d, e, f from B;
Description: displays the 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. title) B
Description: external join query (table name 1: table a 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
Note: five minutes in advance of the schedule
SQL: select * from schedule where datediff ('Minute ', f start time, getdate ()> 5
Note: Two associated tables are used to delete information that is already unavailable to the primary table in the secondary table.
SQL:
Delete from info where not exists (select * from infobz where info. infid = infobz. infid)
Note :--
SQL:
Select. NUM,. NAME, B. UPD_DATE, B. PREV_UPD_DATE FROM TABLE1, (select x. NUM, X. UPD_DATE, Y. UPD_DATE PREV_UPD_DATE FROM (select num, UPD_DATE, INBOUND_QTY, STOCK_ONHAND FROM TABLE2 WHERE TO_CHAR (UPD_DATE, 'yyyy/MM') = TO_CHAR (SYSDATE, 'yyyy/MM') X, (select num, UPD_DATE, STOCK_ONHAND FROM TABLE2 WHERE TO_CHAR (UPD_DATE, 'yyyy/MM') = TO_CHAR (TO_DATE (TO_CHAR (SYSDATE, 'yyyy/MM ') interval between '/01', 'yyyy/MM/DD')-1, 'yyyy/MM') Y, where x. NUM = Y. NUM () and x. INBOUND_QTY NVL (Y. STOCK_ONHAND, 0) <> X. STOCK_ONHAND) B WHERE. NUM = B. NUM
Note :--
SQL:
Select * from studentinfo where not exists (select * from student where studentinfo. id = student. id) and department name = '"& strdepartmentname &"' and major name = '"& strinclusionname &" 'Order by gender, student source, total score of the college entrance examination