Click here to Skip to main content
16,019,597 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Good day!

Please help me search through multiple tables where i can find my match.

example: i have a table

Assignment_tbl and
-------------
code | desc |
1 | aaa |
2 | bbb |
3 | ccc |
-------------

Promotion_tbl
-------------
code | desc |
4 | aaa |
5 | bbb |
6 | ccc |
-------------

Want i want is to know in what table code 4 exist?
i wanted to search through assignment_tbl first if code 4 exist my query should break else if it does not exist in assignment_tbl search through promotion_tbl.

please help me. Thank you in advance.
Posted

1 solution

Just a note: your requirement and its explanation on your example indicates that your database schema is so severely broken that the prospects of supporting it look very questionable.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900