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
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