SQL交叉联接查询不使用变量
此交叉连接工作正常:SQL交叉联接查询不使用变量,sql,sql-server,variables,cross-join,Sql,Sql Server,Variables,Cross Join,此交叉连接工作正常: select * from x, y 我正在尝试运行此查询: select abc.col1 from abc (select * from x, y) abc 但我得到了这个错误信息: Msg 8156, Level 16, State 1, Line 2 The column 'col1' was specified multiple times for 'abc'. 表x和表y具有相同的列和列定义 有什么想法/建议吗 select abc.col1 from a
select * from x, y
我正在尝试运行此查询:
select abc.col1 from abc
(select * from x, y) abc
但我得到了这个错误信息:
Msg 8156, Level 16, State 1, Line 2
The column 'col1' was specified multiple times for 'abc'.
表x和表y具有相同的列和列定义
有什么想法/建议吗
select abc.col1 from abc
(select * from x, y) abc
您正在对两个同名的表使用别名。尝试:
select abc.col1 from abc,
(select x.* from x, y) abc2
您正在对两个同名的表使用别名。尝试:
select abc.col1 from abc,
(select x.* from x, y) abc2
您正在对两个同名的表使用别名。尝试:
select abc.col1 from abc,
(select x.* from x, y) abc2
您正在对两个同名的表使用别名。尝试:
select abc.col1 from abc,
(select x.* from x, y) abc2
除了Lock的答案,您还忘记了逗号:
select
abc.col1
from abc, (select * from x, y) abc2
更好的是,使用ansi 1992符号:
select
abc.col1
from abc CROSS JOIN (select * from x, y) abc2
除了Lock的答案,您还忘记了逗号:
select
abc.col1
from abc, (select * from x, y) abc2
更好的是,使用ansi 1992符号:
select
abc.col1
from abc CROSS JOIN (select * from x, y) abc2
除了Lock的答案,您还忘记了逗号:
select
abc.col1
from abc, (select * from x, y) abc2
更好的是,使用ansi 1992符号:
select
abc.col1
from abc CROSS JOIN (select * from x, y) abc2
除了Lock的答案,您还忘记了逗号:
select
abc.col1
from abc, (select * from x, y) abc2
更好的是,使用ansi 1992符号:
select
abc.col1
from abc CROSS JOIN (select * from x, y) abc2
您必须在内部查询节中指定列名。 大概是这样的:
select abc.col1 from abc
(select x.col1,y.col1 from x, y) abc
您必须在内部查询节中指定列名。 大概是这样的:
select abc.col1 from abc
(select x.col1,y.col1 from x, y) abc
您必须在内部查询节中指定列名。 大概是这样的:
select abc.col1 from abc
(select x.col1,y.col1 from x, y) abc
您必须在内部查询节中指定列名。 大概是这样的:
select abc.col1 from abc
(select x.col1,y.col1 from x, y) abc
谢谢你的回答。我试图将select*from x,y作为变量abc,然后在select语句中使用该变量select abc.col1 from abcAre表x和y中是否有同名的列?如果是这样,则需要使用表名作为前缀,例如从x,y中选择x.*。请看我的更新。谢谢你的回答。我试图将select*from x,y作为变量abc,然后在select语句中使用该变量select abc.col1 from abcAre表x和y中是否有同名的列?如果是这样,则需要使用表名作为前缀,例如从x,y中选择x.*。请看我的更新。谢谢你的回答。我试图将select*from x,y作为变量abc,然后在select语句中使用该变量select abc.col1 from abcAre表x和y中是否有同名的列?如果是这样,则需要使用表名作为前缀,例如从x,y中选择x.*。请看我的更新。谢谢你的回答。我试图将select*from x,y作为变量abc,然后在select语句中使用该变量select abc.col1 from abcAre表x和y中是否有同名的列?如果是这样,则需要使用表名作为前缀,例如从x,y中选择x.*。查看我的更新。