|
Posted on
2011-04-09 20:50
moss_tan_jun
阅读( 262)
评论()
编辑
收藏
举报
select p.* from Products p inner join [ Order Details] o on p.ProductID=o.ProductID |
select p.*,c.* from Products p inner join Categories c on c.CategoryID=p.CategoryID |
select p.*,c.* from Categories c left outer join Products p on p.CategoryID=c.CategoryID order by p.ProductID |
select p.*,c.* from Categories c right outer join Products p on p.CategoryID=c.CategoryID order by p.ProductID |
select p.*,c.* from Categories c full outer join Products p on p.CategoryID=c.CategoryID order by p.ProductID |
select * from Products where unitprice>( select avg (unitprice) from Products) |
select * from Products where categoryID in ( select categoryID from categories) |
select * from Products where unitprice< some ( select avg (unitprice) from Products) |
select * from Products where unitprice<> All ( select avg (unitprice) from Products) |
select * from Products where exists ( select * from categories where categories.categoryID=Products.categoryID and categories.categoryID=2) |
|