outer query returning more than one row [message #681882] |
Sat, 05 September 2020 07:54  |
 |
kumarravik
Messages: 32 Registered: January 2016 Location: delhi
|
Member |
|
|
There are four table joined together.
new requirement have this condition - if note column has any value 'great' then only display the data of this column else rest data will be displayed as usual and note column will have null. We have to join the ord_note table where an order can have multiple nottxt rows.
expectation
Boieng_code Order Note
727 8001 1234567
728 8002
729 8003 3453455
(select 'SHIPment' Boieng_code,
(select case when ord_note.nottxt like 'GREAT%' then SUBSTR(ord_note.nottxt, INSTR(ord_note.nottxt, 'GREAT') + 4) end
from ord_note
where ord_note.nottxt like 'GREAT%'
and ord_note.ordnum = shipment.ship_id
and shipment.carcod = 'DEALS') Note,..........
i have added this inner query which return exactly the record i want but when i run the whole query i receive multiple rows and that does not
satisfy the condition
while Below are coming up
Boieng_code Order Note
727 8001 1234567
727 8001 1234567
727 8001 1234567
|
|
|
|
|