Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

microsoftSQL and mySQL

Status
Not open for further replies.

omax

Programmer
Nov 6, 2001
1
AT
i developed a databse in msSQL and now i should export it to mySQL.
the problem is, mySQL doesn't know sub-selects (the keyword "IN" in the WHERE Statement)

i want to get all applikations where the current_user has no rights (the current user_id is not in table app_user):

3 tables:
---------
applikationen (app_id, app_name)
user (user_id, user_name)
app_user (app_id, user_id)
---------------------------------

select a.app_id, app_name, 0
from applikationen a
left JOIN app_user au ON a.app_id=au.app_id
WHERE a.app_id NOT IN
(
SELECT app_id
FROM app_user
WHERE user_id=1
)
group by a.app_id, app_name

any advice?

thx
omax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top