日期:2014-05-17  浏览次数:20799 次

sql语句怎么写
想以表b的某个条件查询表a数据
A
id   name   userid   class

B
id   userid   chengji  

与B的chengji为条件查询   A   的数据


------解决方案--------------------
chengji int 型:
select A.* from A,B where A.userid=B.userid and chengji=XXXX

chengji varchar 型:
select A.* from A,B where A.userid=B.userid and chengji= 'XXXX '
------解决方案--------------------
up
------解决方案--------------------
1楼正解