I have 2 unrelated tables A and B which both have foreign key constraints on C. I need to run an sql query that determines if either A or B contain a given id of C. My first approach was to use the union all but A and B are not related thus it will not work.
Any ideas?
Not 100% sure what you’re asking but if you mean to return the elements of A and B that match the id in C then this will do it.
Where @somevalue is the value you’re looking for.