Link to home
Start Free TrialLog in
Avatar of rupeshp_shah
rupeshp_shah

asked on

Subquery

Can we use subquery in the from clause in sybase .
We can do the same in oracle using inline views.
Is there any way to get the same in sybase
Avatar of Lowfatspread
Lowfatspread
Flag of United Kingdom of Great Britain and Northern Ireland image

you should be able to...
which version are you using?
ASKER CERTIFIED SOLUTION
Avatar of arp551
arp551

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sybasetogo
sybasetogo

You can use subquery in from (like oracle). You can create real view for this.
But you can use subquery in select columns list (oracle can't ).
For example :
select a, (select b from tableB where ...) b from tableA ...

Creating temporary table is another option. Note that not like in oracle temporary tables are local for your session.
You need to create them in every session (while in oracle you create it only once and only data is local for session).

In-line views (also known as "derived tables") are being added to ASE as a new feature in the
12.5.1 release, which should be available around late September.