Table join - merging 2 tables
Table 1 has item_id, trans_date, trans_qty, etc.
Table 2 has item_id, trans_date, trans_qty, etc.
The problem I have is that I am trying to get the first 10 transaction from both tables.
What I do is
select item_id, trans_date,trans_qty,'T1' from table_1 where item_id = 111
union all
select item_id, trans_date,trans_qty,'T2' from table_2 where item_id = 111
order item_id, trans_date;
The problem with is that I am trying to get only the first 10 rows.
But when I look at the explain plain it retreive all data from Table_1 and Table_2 which is long.