Question : Query does not return rows

Happy new year to you!

I am having a strange problem today, which I can hardly understand! Thus I wanted to ask you!

I have a very simple query, which used to work as far as I remember. Now, however, the query doesn't return any rows at all. Can you please tell me what is wrong? CNT_GEBIET is a string just like lng_gebiet. Both are varchar2.

I simply need to output all records of table tbl_gebiet, which are non existent in tbl_arbeit_zu_gebiet.

I appreciate your help and am very curious if you have any ideas!

BR,
skahlert2010

Code Snippet:
1:
Select distinct cnt_gebiet from VT_TBL_GEBIET where cnt_gebiet not in (Select distinct lng_gebiet from VT_TBL_ARBEIT_ZU_GEBIET)

Answer : Query does not return rows

your query should work. For perfornance reason you should use a structure like this.
If the query dont return any rows then all the cnt_gebiet values have corresponding value in the lng_gebiet column.
1:
2:
3:
4:
5:
SELECT distinct cnt_gebiet 
FROM VT_TBL_GEBIET T1
WHERE NOT EXISTS (	SELECT NULL 
					FROM VT_TBL_ARBEIT_ZU_GEBIET T2 
					WHERE T1.cnt_gebiet = T2.lng_gebiet)
Random Solutions  
 
programming4us programming4us