概要 本节要实现的是多表关联查询的简单demo.场景是根据id查询某商品分类信息,并展示该分类下的商品列表. 一.Mysql测试数据 新建表Category(商品分类)和Product(商品),并插入几条测试数据. create table Category ( Id int not null auto_increment, Name ) null, constraint pk_category primary key (Id) ); INSERT INTO category(Name) VAL
一.多表关联查询 1,left join RelaTimeLog表 和 ValidFlight表关联查询 order by t.FlightId desc 2,与group by连用 group by FlightId) order by t.FlightId desc 二.分页 1,查询0到10条 and order by t.Etd desc 2,BETWEEN * AND * , Row_Number() OVER(ORDER BY *) AS rowNum group by Fli