Table1 fields and datas : (itemcode,itemdesc)
(101, aaa)
(102, bbb)
(103, ccc)
(104, eee)
(105, fff)
(106, ggg)
(107, hhh)
Table2 fields and datas : (itemcode, finperiod, finyear)
(101, 'jan-14', fy2014)
(101, 'feb-14', fy2014)
(102, 'jan-14', fy2014)
(102, 'feb-14', fy2014)
(103, 'jan-14', fy2014)
(104, 'feb-14', fy2014)
(105, 'mar-14', fy2014)
(101, 'mar-14', fy2014)
(102, 'feb-14', fy2014)
Query like this : To get itemcode where finperiod='jan-14' not in finperiod='feb-14'and finyear='fy2014' and itemdesc = 'aaa';
if above query executes then the output should be like this : 103.
I got this output but I used to separate this two table into multiple table that means to split tables like a_jan, a_feb, a_mar...