I've got a query in which I want the store_ids to show up whether or not there is any data attached. I've tried left outer, right outer, full outer and nothing seems to work. Interestingly enough the second left outer on employees works.
What am I missing?
I'm using PostGresql 7.4.1
Here's my SQL:
Thanks
What am I missing?
I'm using PostGresql 7.4.1
Here's my SQL:
Code:
select store.store_id, store.short_name,
store.suffix,
ia.date, ia.time, ia.sec,
ia.transaction_type, ia.item_number,
ia.cost, ia.price, ia.category,
ia.date_in, ia.last_ptn,
ia.gunbook_num, ia.gunbook_page, ia.gunbook_line,
ia.description, ia.quantity, ia.last_ptn,
rtrim(employee.last_name) as emp_lastname, rtrim(employee.first_name) as emp_firstname
from inventory_audit ia
left outer join store on store.store_id = ia.store_id
left outer join employee on (ia.userid = employee.userid and ia.store_id = employee.store_id)
where ia.transaction_type in ('M','A','D') and store.store_id = 84 and ia.date = '2006-06-20'
Thanks