exists 的使用

SELECT u.login_id,
(select from dual where exists(select from mdp_user_login_info muli where muli.BIZ_SYS = 'admin' and u.login_id=muli.user_id
and muli.LOGIN_TIME < now() and now() < muli.LOGOUT_TIME ) ) as attribute4
FROM MDP_SEC_USER u WHERE u.DELETION_FLAG = 'F' AND (u.TYPE = 'b' OR u.TYPE = 'p') and u.login_id like '%engwp%'
ORDER BY u.ID limit ,;

查询某记录是否存在,存在返回 1

上一篇:javaweb写的在线聊天应用


下一篇:C# 迪杰斯特拉算法 Dijkstra