How can I select
more than one table in sql server while using a single where
clause condition for both tables? For example, if I had two tables named table1
, table2
, then:
select * from table1,table2 where rollno=1
But in the above query it gives me error -
ambiguous column
which is logical.
提供Alias name
或使用tablename
以避免ambiguous column error
并尝试。
select * from table1 A,table2 B where A.rollno=1 AND B.rollno=1
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.