LuckyDanger
MIS
The main aim of the SQL query is to show only records with 'A0' or 'A1' in a field and also only show those records in another field with 't1' or 't2'
Not all appropriate records are returned with this query i.e. expected results show records missing.
Here is my sql query:
SELECT tab1.accnt_code, tab1.Period, tab1.trans_date, tab1_amount, tab1.anal_t0, tab1.anal_t1, tab1.anal_t2, tab1.anal_t3, tab1.anal_t4, tab1.anal_t5
FROM sindb.dbo.tab1 tab1
WHERE (tab1.anal_t2=’A1’) OR
(tab1.anal_t2=’A0’) AND
(tab1.accnt_code=’T1’) OR
(tab1.accnt_code=’T2’)
ORDER BY tab1.accn_code, tab1.anal_t1
Not all appropriate records are returned with this query i.e. expected results show records missing.
Here is my sql query:
SELECT tab1.accnt_code, tab1.Period, tab1.trans_date, tab1_amount, tab1.anal_t0, tab1.anal_t1, tab1.anal_t2, tab1.anal_t3, tab1.anal_t4, tab1.anal_t5
FROM sindb.dbo.tab1 tab1
WHERE (tab1.anal_t2=’A1’) OR
(tab1.anal_t2=’A0’) AND
(tab1.accnt_code=’T1’) OR
(tab1.accnt_code=’T2’)
ORDER BY tab1.accn_code, tab1.anal_t1