Skip to Content
1
Mar 30, 2016 at 09:31 PM

Using LIMIT 1 instead of TOP 1 in subquery

10126 Views

Hi folks,

I'm trying to do a subquery with TOP1 which isn't supported so I was reading that LIMIT 1 should work but I'm still getting similar error correlated subquery cannot have TOP or ORDER BY.

EXAMPLE:

select

field1,

field2,

(select PROFIT_CTR from "MySchema"."MyTable" where COMP_CODE = '1234' LIMIT 1) as PC)

from "MySchema"."OtherTable" where....

etc

Any suggestions?

Thanks!

-Patrick