Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Can you help me write this SQL query.

$
0
0

This query works:-

Select col_ID,col_Name as Name from TableName

But; I want the part after AS (coloumn name) dynamic:-

Select col_ID,col_Name as (Select tl_name from Table2 where tl_col_Name='col_Name') from TableName

The highlighted part throws error. 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>