在我的查詢中,我想檢查具有指定權限的用戶是否存在。目前我正在使用下面的查詢。它將檢索具有指定條件的授權用戶行。格式化mysql查詢輸出
select a.ixUserAuthorization from tblechecklistuserroleassignmentxref r
inner join tblechecklistuserrole u on u.ixUserRole=r.ixUserRole and u.sname='Initiator'
inner join tblechecklistuserauthorization a on a.ixUserAuthorization=r.ixUserAuthorization
and a.ixcustomer='1'and a.ixprogram='1'and a.ixworkpackage='1'and a.ixactivity='1' and a.ixUser='626e28e8-e67a-4d11-8d2c-129d0ab79e96';
如果任何行返回我想要顯示的結果爲真,如果沒有行從上述查詢我想要顯示的結果爲假返回。
如何修改以獲得結果爲true或false。
?如何計算選擇查詢結果的行數? –
在結果上使用函數mysql_num_rows() – Uttara