>Dear All,
>
>I have a small problem which will be a big solution for me, where I have a SQL statement not giving the right answer for what I need, I have table (a) and table (B) I need to show all records which in table (a) and the releated records in table (b) but the problem is giving me the opposite result it is giving table (b) what only releated in table (A) so I do not get the right answer, I wanted to have all the records in (a) and matching with records in (b) table, any idea ????
>
>thanks
>
>Hisham
Hisham,
You'd use an outer join. Using testdata.dbc customer and orders table SQL would look like (notice that not all customer's have an order) :
select * from customer a LEFT outer join orders b on a.cust_id = b.cust_id
Cetin