MySQL高级用法

-- 关联查询
-- select * from Goods_BomItems s,Goods_Bom t where t.GoodsBomId = s.GoodsBomId and t.GoodsBomCode='1042669'

-- 范围查询
-- select * from Goods_Bom where GoodsBomCode in ('','')

-- 模糊查询
-- select * from Goods_Bom where GoodsBomName like '%%'

-- 倒序排序
-- select * from Goods_Bom order by CreateTime DESC;


-- 分组查询
-- SELECT t.GoodsBomName, COUNT(*) from Goods_Bom t
-- group by GoodsBomName

 

-- 子查询

select * from Goods_BomItems
where (GoodsBomId) = {
SELECT * from Goods_Bom
where goo
}

posted @ 2018-03-26 15:04  干饭人~  阅读(194)  评论(0编辑  收藏  举报