select * from 表名 where 列名 is not null 查出的是该列不为空的N行数据 至于你说的想用 select * 查出不为空的'列',我想是无法实现的
select distinct sect_office from users where sect_office is not null 表结构如下: userid name sect_office depart 1 aa w1 2 bb ddb w1 3 cc ddb w1 4 dd w1 就这样得表结构,要查询sect_office不为空得记录,是depart和sect_office得ajax联动,用select distinct sect_office from users where sect_office is not null and dept='w1'查是错误得
是这样的吧: select distinct sect_office from users where sect_office='w1' and sect_office is not null;
userid name sect_office depart 1 aa w1 2 bb ddb w1 3 cc ddb w1 4 dd w1 就这样得表结构,要查询sect_office不为空得记录,是depart和sect_office得ajax联动,用select distinct sect_office from users where sect_office is not null and depart ='w1'查是错误得,可能是这样的表结构,我以前遇到过,没解决,求解各位大侠了
是depart和sect_office得ajax联动??? 不是很明白
是depart和sect_office得ajax联动???
select *from pj_ckls(表名) where ckpaper(列名) not in (select ckpaper(列名) from pj_ckls(表名))
查出的是该列不为空的N行数据
至于你说的想用 select * 查出不为空的'列',我想是无法实现的
表结构如下:
userid name sect_office depart
1 aa w1
2 bb ddb w1
3 cc ddb w1
4 dd w1
就这样得表结构,要查询sect_office不为空得记录,是depart和sect_office得ajax联动,用select distinct sect_office from users where sect_office is not null and dept='w1'查是错误得
是这样的吧:
select distinct sect_office from users where sect_office='w1' and sect_office is not null;
你可以查询出来列的值,但是你查询不出来为null的那个列名字啊!你可以上视图里面desc下表结构,看下那列可以为null。
1 aa w1
2 bb ddb w1
3 cc ddb w1
4 dd w1
就这样得表结构,要查询sect_office不为空得记录,是depart和sect_office得ajax联动,用select distinct sect_office from users where sect_office is not null and depart ='w1'查是错误得,可能是这样的表结构,我以前遇到过,没解决,求解各位大侠了
不是很明白