组合查询纵表
有A表,结构如下:
id,field,value
查询目标:value为A且value为B的id
写一个函数b(),入参,id,value。
select a.value from a where id = 参数id and value = 参数value
查询伪sql:
select * from a where b(a.id,'A') is not null and b(a.id,'B') is not null
发布时间: 2012-09-05 15:19:35 作者: rapoo
组合查询纵表
有A表,结构如下:
id,field,value
查询目标:value为A且value为B的id
写一个函数b(),入参,id,value。
select a.value from a where id = 参数id and value = 参数value
查询伪sql:
select * from a where b(a.id,'A') is not null and b(a.id,'B') is not null