我的第三题答案(头晕晕的时候写的,等休息好再测试下)
alter table OrderIma add OTime datetime;
select IID,INAME,IONHAND from Item where ITYPE='T' and IONHAND<10;
SELECT OPID FROM OrderIma GROUP BY OPID HAVING COUNT(OPID)>0;
select PID,PNAME,PSCORE from Provider where PID in (select PID from OrderIma where OIID='50120046' group by OPID having count(OIID)=0);
select Item.IID,Item.INAME,Item.IONHAND,Provider.PID,Provider.PNAME from Item,Provider where Provider.PCITY='北京';
上面第三题第四小题的答案是错的,采用子查询的方式。
SELECT NAME FROM test WHERE NAME NOT IN (SELECT NAME FROM test WHERE fruit='西瓜') GROUP BY NAME;