I have a table and the columns Voucher and Settlevoucher.The query:select VOUCHER, SETTLEVOUCHER from table WHERE VOUCHER ='FRCXXXX'
returns exactly one result with SETTLEVOUCHER='COBXXXX' OR NULL with VOUCHER being singular for all FRC-numbersIn the second step I query what was the result of query1:select VOUCHER, SETTLEVOUCHER from table WHERE VOUCHER ='COBXXXX'
this gives me a non predictible amount of results, because VOUCHER is not singular for the COB-numbers.As I'm trying to do this 2 steps in one, I am missing results and I do not understand why.Select t.VOUCHER, t.SETTLEVOUCHERFROM table LEFT OUTER JOIN table as t ON table.SETTLEVOUCHER=t.VOUCHERWHERE table.VOUCHER ='FRCXXXX'
No matter if I do an inner join, left or right outer join the result is always only one, while it should be what returns query2 taken separately.What am I do wrong?Martin