I am new to sql queries. I have base query that fetches data from these 3 tables and below is the query,
select t.transction_id,pt.name,pa.date from transaction t, position_acc pa,position_trans pt where
t.transction_id=pt.transction_id and pt.postion_id=pa.postition_id
=======================
Now i have a requirement I have to fetch data from another table call, movement
and here is the condition from my client.they need all data from movement table ,even if there is no matching data in position_trans or position_acc.
So, here is the condition my client:
select t.transction_id ,m.movement_id from transction t,movement m where t.transction_id=m.movement_id and m.name="CASH"
How can I club this condition with my base query.client need all data from movement .if matching columns doesn't have entry in position_trans or position_acc,they are fine.They will accept the columns from these column as null.
So, how can I put my movement condition in base query.Please help
======
select t.transction_id ,m.movement_id from transction t,movement m where t.transction_id=m.movement_id and m.name="CASH"
Record count =1500.
The count should be same after appending with base query.