I have to use SubClass1 as Column name of other query Like :
select SubClass1 from abc
how to pass Subclass1 as string in function
this is my Response of sql query
select Fieldname from xyz where id='1':
FieldName
----------------
SubClass1
I have to use SubClass1 as Column name of other query Like :
select SubClass1 from abc
how to pass Subclass1 as string in function
this is my Response of sql query
select Fieldname from xyz where id='1':
FieldName
----------------
SubClass1
3条答案
按热度按时间gfttwv5a1#
You can use sub query, select sql command.
for example in your code:
please use northwind simple database and try it... also return you respond about Nested select
lsmepo6l2#
You should use dynamic sql.
First store query response into a variable.
then use that variable into dynamic sql query.
NOTE: here example is only for single output from first query response. if you want multiple columns then you should use
COALESCE
to combine rows into a single result.7xzttuei3#
You can use dynamic SQL