SQL > ???? > Insert Into

???? ??? ???? ??? ?? ???? ??? ?????. ??? ?? ????? ??? ??? ?????????? ? ??? (INSERT INTO) ? ?? ??? (UPDATE) ? ???????.

???? ???? ?????? ??? ??? ????. ??? ??? ??? ??? ??????? ?? ???? ??? ??? ????????. ?? ??? ??? ???? ??? ?? ?????.

??? ?? ??? ?? ??? ?????. ??? ??? ???? ???? ???:

INSERT INTO "???" ("?? 1", "?? 2", ...)
VALUES ("?? 1", "?? 2", ...);

???? ?? ??? ?? ??? ??? ????:

Store_Information ??
??? ?????
Store_Name char(50)
Sales float
Txn_Date datetime

??? ??? ?? ???? ??? ???? ???: January 10, 1999, Los Angeles ??? ???? $900 ???. ??? ??? ?? SQL ??? ?????:

INSERT INTO Store_Information (Store_Name, Sales, Txn_Date)
VALUES ('Los Angeles', 900, 'Jan-10-1999');

??? ??? INSERT INTO ? ??? ???? ???? ???? ????. ? ?? ????? ??? SELECT ??????? ??? ??? ???? ???? ?? ????. ?? ? ???? ?? ???? ????? ????? ?? ?????. ??? ??? ???? ???? ???:

INSERT INTO "?? 1" ("?? 1", "?? 2", ...)
SELECT "?? 3", "?? 4", ...
FROM "?? 2";

??? ??? ?? ???? ????. ??? ???? SQL ? WHERE, GROUP BY,? HAVING ? ?, ? ?? ?? ? ????? ???? ????.

?? ?? 1998 ?? ??? ???? Store_Information ??? ???? ?? ??? ?? ? Sales_Information ??? ?? ??? ????? ??? ?? ??? ?? SQL ? ?????:

INSERT INTO Store_Information (Store_Name, Sales, Txn_Date)
SELECT Store_Name, Sales, Txn_Date
FROM Sales_Information
WHERE Year (Txn_Date) = 1998;

??? ?? SQL Server?? ??? ???? ???? ??? ??????. ??? ??????? ??? ?????. ?? ?? Oracle ??? WHERE TO_CHAR (Txn_Date, 'yyyy') = 1998 ? ???????.

SQL UPDATE >>
?


Copyright © 2021   1keydata.com   All Rights Reserved