SQLTeam.com | Weblogs | Forums

How to fetch the set of data from one or another table in sql

both tables a, b have the few attributes are same
getting data exists from a or b
before getting from a or b i have few tables join left joins and how to join a, b with other tables?
for example
........ join ...... k
left join y
on k. = y.
left join z
on k. = z.
how to join either a or b fetching data
where a.cust_id = ???

The question isn't very clear - but if I am understanding what you are asking then you outer join both tables and then use COALESCE(a.col1, b.col1) to return the first non-null value.