Question john.smith4237 · Jan 2

Nested queries

Hi Guys,

This Nested query is not working for some reason, but they work fine when executing  separately ?  

select id from FDRD_Com.List where vehicle in (select Car from FDRD_Com.Prod where ProductLineName='Toyota' and Car is not null)

Thanks

Product version: Ensemble 2018.1

Comments

Robert Cemper · Jan 2

IN is expecting a list.

Did you ever try

selectidfrom FDRD_Com.List where vehicle IN
(selectLIST(Car) from FDRD_Com.Prod where ProductLineName='Toyota'and Car isnotnull)


on the sub select ?

0
Robert Cemper · Jan 2

different approach:

SELECT LI.id from FDRD_Com.List LI
JOIN FDRD_Com.Prod PR
ON LI.vehicle = PR.Car 
WHERE PE.ProductLineName='Toyota'AND PR.Car isnotnull-- might be obsolete
0
john.smith4237  Jan 2 to Robert Cemper

LIST didn't work but the Join did, thanks you very much Robert.

As I recall, Nest queries didn't work well if all in the old Cache versions so not sure if they improved it !?

0