I am having a very strange issue in SQL Anywhere version 11.0.1.3158, here is a very simple sample (in real life there are much more columns and conditions):
but and Why can't I pass an alias to
|
When you try to call a stored procedure with a column as argument and want to join the procedure's result set with other columns, you are basically making a LATERAL call, and therefore I would recommend to try that or the alternative CROSS APPLY operator, i.e. something like
or
Note: I've checked that with v12.0.1.4436, which also accepts your sample query "SELECT 123 as a, (select c2 from proc2(a))" but rejects "SELECT c1 as a, (select c2 from proc2(a))", so I'm not sure whether both suggested queries work with v11... |