SQL中的子查询(sql中的子查询的用法)
select product.id ,detail.name ,product.price -- 可以把区分code转换为名称 , (SELECT testFild from country where country.id = product.id) AS testFild -- 当满足某些条件的时候才会进行查询 ,CASE WHEN product.price > 100 THEN (select country from country where country.id = product.id) ELSE '其他' END countryfrom product left JOIN detail ON product.id = detail.id
标签:product,country,detail,查询,SQL,id,select,testFild
来源: https://blog.csdn.net/feyehong/article/details/121444493