门牙有缝修补要多少钱:ASP的问题,关于查询

来源:百度文库 编辑:神马品牌网 时间:2024/05/09 14:53:01
数据库内存在两个列表
员工状况 员工部门
在职员工 业务部
实习员工 财务部

查询条件
所有员工列表
exec="select * from aaa order by id DESC"
查询所有在职员工
'exec="select * from aaa where state='实习员工' order by id DESC "
问:
查询业务部门的所有的实习员工.应该怎么写?
好像不行.现在我自已是这样写的
exec="select * from aaa where state='实习员工' and brannd='业务部' order by id DESC "
可以查询出正确结果.
但是,如果这样写的话.就无法查询单一查询所有的"实习员工"了.因为."业务部"的值为空.所以,无法查询到数据

查询业务部门的所有的实习员工:

'exec="select 实习员工 from aaa where state='业务部' order by id DESC "