Wednesday, 21 August 2013

Is there anything wrog with this SQL query?

Is there anything wrog with this SQL query?

Folowing is the query returning zero rows, actually it shouldn't:
SELECT distinct(usr.user_id) FROM OCN.users AS usr,
OCN.users_groups_subscribe AS usr_grp, OCN.tests_users AS test_usr WHERE
usr.user_id=usr_grp.subscribe_user_id AND
usr.user_id=test_usr.test_user_user_id AND test_user_test_id=116 AND
(usr.user_first_name LIKE '%ajay%' OR usr.user_last_name LIKE '%ajay%')
ORDER BY usr.user_first_name, usr.user_last_name

No comments:

Post a Comment