当前位置: 代码迷 >> Web前端 >> 结合查询纵表
  详细解决方案

结合查询纵表

热度:274   发布时间:2012-09-05 15:19:35.0
组合查询纵表
有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
  相关解决方案