几个简单常用的Sql语句

select SUM(Gnumber) as Ids from Goods where Cids = '2';
--查Cids为2的Gnumber列的和,列名为Ids
select Cids,Plevel from People;
select * from Salary;
select * from Salary,People where People.Plevel = Salary.Slevel;
--查Salary,People两个表
select SUM(Ssalary) as salary from Salary,People where People.Plevel = Salary.Slevel and Cids = '2';
--合并Salary,People,查Cids为2的Ssalary列的和,列名为salary

 

posted @ 2017-11-17 22:49  _Iniesta  阅读(292)  评论(0编辑  收藏  举报