数据库SQL开始学习_2

先上表

1.WHERE 的例子

  列出所有加拿大Canadian城市的信息(包括所有字段) 

代码:

  SELECT *

  FROM North_american_cities

  WHERE Country = "Canada";

 

2.

SELECT *

  FROM North_american_cities
  WHERE Country = "Mexico"
  ORDER BY Population DESC
  LIMIT 2

 

代码:

  SELECT *

  FROM North_american_cities
  WHERE Country = "United States"
  ORDER BY Population DESC
  LIMIT 2 OFFSET 2

posted @ 2019-09-19 11:15  浅隐  阅读(396)  评论(0编辑  收藏  举报