数据库

SQL基础简明总结

总计 626 字
Inner Join 只含有关联的行 SELECT field1, RTRIM(field2) AS f2 FROM table_one INNER JOIN table_two ON table_one.table_two_id = table_two.id GROUP BY field1, f2 AVING COUNT(table_two.credit) > 2 WHERE condition1 AND condition2 AND field1 LIKE '%@hotmail.com' ORDER BY field3; Self Join 可用于替代子查询 SELECT c1.cust_id, c1.cust_name, c1.cust_contact FROM customers AS c1, customers AS c2 WHERE c1.cust_name = c2.cust_name AND c2.cust_contact =