tags:

views:

25

answers:

1
select TO_CHAR(TRUNC(SYSDATE),'DD MONTH,YYYY'),a.appl_no,a.assigned_to,c.trading_name co_name, ' ' co_name2, d.bank_acct_no  credit_acct_no, d.bank_no credit_bank_no, d.bank_branch_no credit_branch_no,a.service_id
    from newappl a, newappl_hq b, newappl_ret c, newappl_ret_bank d where a.appl_no = c.appl_no and c.ret_id= d.ret_id and a.appl_no=(select appl_no from newappl where appl_no='224') and c.outlet_no in ('1','2') and rownum=1

Why the out put for above statment is only one row while I have 1 & 2 for following statement

select c.outlet_no from newappl_ret c where appl_no = '224'
+1  A: 

its hard to say when you dont see data stored in db but try this one:

select c.outlet_no from mss_t_newappl_ret c where appl_no = 224

check if in the column appl_no there isnt any spacebar

maybe this?

and a.appl_no IN (select appl_no from newappl where appl_no='224')

or delete this expression

and rownum=1
Sebastian Brózda
I can't remove rownum=1 as in above comment. And appl_no is same for both outlet_no.
daydream