第十天下午、结课,最后实现查询条件的sql语句

2020-08-21  本文已影响0人  别学编程
select rownum,form.* 
from (select distinct o.o_code,o.o_user_account,o.create_date,o.o_total,p.pro_brand
from tb_orders o,tb_orders_product op,tb_product p 
where o.o_code = op.o_code 
and op.pro_id = p.pro_id 
and o.o_user_account like concat(concat('%','3'),'%')
and o.o_code like concat(concat('%','d'),'%')
and o.create_date between '2010-01-01' and '2021-01-01'
and p.pro_name like concat(concat('%','成'),'%')
and p.pro_brand like concat(concat('%','飞'),'%')) form
上一篇 下一篇

猜你喜欢

热点阅读