联结表 例:
SELECT vend_name,prod_name,prod_price
FROM vendors,products
WHERE vendors.vend_id = products.vend_id
ORDER BY vend_name,prod_name;
插入数据
插入使用INSERT.
1.插入完整的行:
INSERT INTO customers (cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country,cust_contact,cust_email)
VALUES('PEP','100 main','Los Angeles','CA','90046','USA',NULL,NULL);
2.插入检索出的数据
INSERT INTO customers(cust_id,cust_contact,cust_email,cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country)
SELECT cust_id,cust_contact,cust_email,cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country
FROM custnew;
SELECT语句从custnew检索出要插入的值。也可包含WHERE子句过滤的数据。