navigator703
MIS
I have been searching the normal sites [will remain nameless], but I should have tried here first. Ugh how we realize the best answer is the first answer. I have run the normal search, but haven't found anything near to my question in the forums.
Anyway, for general knowledge purposes how would you select multiple columns as just column result. For example if there a many different ID's [atm, parking, tenant] and I would like to make the return data set equal ID, how would I go about doing this?
Here is the example in question:
This is what I have started with, but have the error
~ a journey of a thousand miles must begin with a single step ~
Anyway, for general knowledge purposes how would you select multiple columns as just column result. For example if there a many different ID's [atm, parking, tenant] and I would like to make the return data set equal ID, how would I go about doing this?
Here is the example in question:
Code:
select occpt_id, (select o1.cafe_id, o1.tnnt_id, o1.park_id, o1.mortg_ofc_id, o1.atm_id, o1.brn_id from t_occpt o1) as specocc
from t_occpt
This is what I have started with, but have the error
Code:
Server: Msg 116, Level 16, State 1, Line 1
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
~ a journey of a thousand miles must begin with a single step ~