I have a simple query that needs to be complicated to suit permissions. This is the simple query: select INNERCODE, Description from TypTbl
Now, I have another permissions table that may or may not specify allowed TypTbl values for each user. I tried changing the above query to: select INNERCODE, Description from TypTblwhere (exists (select User_InnerCode from TblUser where User_UserCode = 1) and INNERCODE in (select User_TableCode from TblUser where User_TableType = 'T' and User_UserCode = 1))
This was supposed to retrieve all values if the exists sub-query returns false and retrieve specific values if it returns true. However, it doesn't work. It does retrieve specific values if there is a permission defined, but it does not retrieve anything if there is no permission defined.What am I doing wrong and how do I repair it?TIA, Yariv