i have a join where when i get the results. It removes any rows with a null value. I want to include the nulls as well.
eg. This works
select a.customer_no, a.perf_code, a.perf_dt, a.num_seats, a.tck_amt, a.order_dt, a.location, a.section,
c.description as 'Prefix', b.fname, b.lname, b.create_dt as 'LengthOfTime',
d.street1, d.street2, d.city, d.postal_code,
e.description as 'Country',
a.mos_category,
g.description as 'Let',
a.price_type
from lt_ticket_hist a, t_customer b, tr_prefix c, t_address d, tr_country e, t_perf f, tr_perf_type g
where a.customer_no = b.customer_no
and b.prefix = c.id
and a.customer_no = d.customer_no
and d.country = e.id
and a.perf_code = f.perf_code
and f.perf_type = g.id
and a.perf_code like 'PROM%'
and d.inactive <> 'Y'
but when i add in the h.description as 'PriceType' and the join for and a.price_Type = h.id like below I get about 150000 less results because the mos is null. How do i include the nulls.
select a.customer_no, a.perf_code, a.perf_dt, a.num_seats, a.tck_amt, a.order_dt, a.location, a.section,
c.description as 'Prefix', b.fname, b.lname, b.create_dt as 'LengthOfTime',
d.street1, d.street2, d.city, d.postal_code,
e.description as 'Country',
a.mos_category,
g.description as 'Let',
a.price_type,
h.description as 'PriceType'
from lt_ticket_hist a, t_customer b, tr_prefix c, t_address d, tr_country e, t_perf f, tr_perf_type g, tr_MOS h
where a.customer_no = b.customer_no
and b.prefix = c.id
and a.customer_no = d.customer_no
and d.country = e.id
and a.perf_code = f.perf_code
and f.perf_type = g.id
and a.price_Type = h.id
and a.perf_code like 'PROM%'
and d.inactive <> 'Y'
is it just a different join?
Start Free Trial