可以用 select count(*) from table where username ='dpstill';
查询的结果=0 就不存在 >0 就存在
如果要用其他结果返回的话,可以用下面的
select case when COUNT(*)>0 then '存在' when count(*)=0 then '不存在' end from table where username ='dpstill'
可以用 select count(*) from table where username ='dpstill';
查询的结果=0 就不存在 >0 就存在
如果要用其他结果返回的话,可以用下面的
select case when COUNT(*)>0 then '存在' when count(*)=0 then '不存在' end from table where username ='dpstill'