Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

Can SQL Statement Show NOT_FOUND records

$
0
0

Hi

In Oracle DB I have a table named TABLE1 Assume TABLE1 contains the following data

ID        Name        Phone        Status

1         AAAA         111         Active

2         BBBB         222         Cancelled

3         CCCC         333         Active

I need to run SQL statement like

SELECT * from TABLE1 WHERE ID in (1,3,4,6)

This statement will return two records with ID 1 and 3 only because no record found with ID = 4 or 6

What modification can I do to my SQL statement to make it returns the found records Plus the not-found records. For the above SQL I need to get the following result:

ID        Name        Phone        Status

1         AAAA         111          Active

3         CCCC         333          Active

4          null           null           NOT_FOUND

6          null           null           NOT_FOUND

 

Please let me know how if that  is possible

thanks


Viewing all articles
Browse latest Browse all 1350

Trending Articles