请问:在mssql中用SELECT语句做表名或者列名的语法是什么样的?
scige 2003-12-03 06:16:56 就是用子查询的结果来作表明或者列名
比如表table中有id,name列,有一个数据为id=1,name=user
还有一个名为user的表,其中有uid,username等列
select username from (select name from table where id=1) as new
where uid=2 ~~~~~~
这句出错,不知道问题在哪里
请高手指点。
我看到有文章说~~~~那里应该用别名,这是为什么?