select * from a,b where a.hh=b.hhorselect * from a join b on a.hh=b.hh
select a.* ,b.* from a,b where a.hh=b.hh; 或者表别名select Table1.* ,Table2.* from a Table1,b Table2 where Table1.hh=Table2.hh;如果字段名不同,那么就不用加上表名标示,你要用就更好 例如: select a.* ,b.* from a,b where h1=h2; select a.* ,b.* from a,b where a.h1=b.h2;
select * from a,b where a.hh=b.hh or select * from a,b where b.hh=a.hh
select * from a,b where a.hh=b.hh or select * from a,b where b.hh=a.hh or select * from a inner join b on a.hh=b.hh都是正解。
select * from a,b where a.hh=b.hh or select * from a,b where b.hh=a.hh or select * from a inner join b on a.hh=b.hh
select * from table1 a,tabl2 b where a.hh=b.hh
select * from a,b where a.hh=b.hh
I guess the sponsor must be fool us!
up to jackluo1981(无知者无畏)
select * from a,b where a.hh=b.hh
select * from a,b where a.hh=b.hh or select * from a,b where b.hh=a.hh or select * from a inner join b on a.hh=b.hh是正解啊 怎么楼主不说话..........
楼主lipeng_cq发贴后没有再跟贴:-)
select * from a,b where hh.a=hh.b; -------------------- 应该是 select * from a,b where a.hh=b.hh; 也就说是 select * from 表a,表b where 表a的字段hh=表b的字段hh;--表名在前面,字段跟在表名加.的后面
select * from a,b where a.hh=b.hh 这个语句的问题在于你关联了两个表,而显示时用*来代替,系统并不知道要代替哪一个表,所以要写清楚 可以这样写: select a.* ,b.* from a,b where a.hh=b.hh
或者表别名select Table1.* ,Table2.* from a Table1,b Table2 where Table1.hh=Table2.hh;如果字段名不同,那么就不用加上表名标示,你要用就更好
例如:
select a.* ,b.* from a,b where h1=h2;
select a.* ,b.* from a,b where a.h1=b.h2;
or
select * from a,b where b.hh=a.hh
or
select * from a,b where b.hh=a.hh
or
select * from a inner join b on a.hh=b.hh都是正解。
or
select * from a,b where b.hh=a.hh
or
select * from a inner join b on a.hh=b.hh
or
select * from a,b where b.hh=a.hh
or
select * from a inner join b on a.hh=b.hh是正解啊 怎么楼主不说话..........
--------------------
应该是
select * from a,b where a.hh=b.hh;
也就说是
select * from 表a,表b where 表a的字段hh=表b的字段hh;--表名在前面,字段跟在表名加.的后面
这个语句的问题在于你关联了两个表,而显示时用*来代替,系统并不知道要代替哪一个表,所以要写清楚
可以这样写:
select a.* ,b.* from a,b where a.hh=b.hh