select SJ_Power.id,UserID,Place_ID ,Part_ID,S_Place,SJ_Part from
SJ_User inner join SJ_Power on SJ_Power.UserID=SJ_User.id
SJ_Place inner join SJ_Power on SJ_Power.Place_ID=SJ_Place.id
SJ_Part inner join SJ_Power on SJ_Power.Part_ID=SJ_Part.id
SJ_User inner join SJ_Power on SJ_Power.UserID=SJ_User.id
SJ_Place inner join SJ_Power on SJ_Power.Place_ID=SJ_Place.id
SJ_Part inner join SJ_Power on SJ_Power.Part_ID=SJ_Part.id
from SJ_POWER,SJ_PLACE,SJ_PART
where
sj_power.id=sj_part.id and sj_pwer.id=sj_part.id
很急。
告诉我怎样写啊?
from SJ_POWER,SJ_PLACE,SJ_PART
where
sj_power.id=sj_part.id and sj_pwer.id=sj_part.id
好象类似我现在用的自定义查询哦。不过我是c/s,不是b/s.
就是后面要有Where Suser='admin'
你的查询多出了两条数据,不符合啊
就是后面要有Where Suser='admin'
from SJ_POWER,SJ_PLACE,SJ_PART,sj_user
where
sj_power.id=sj_part.id and sj_pwer.id=sj_part.id and
sj_power.id=sj_user.id and sj_user.suser='admin'有问题要问了!
那几张查询表不能跟sj_user关联啊,他们之间好像没有什么联系。如果硬要做,就只能上面那样了。
多了哪两条记录啊?
把结果复制给我看
你写的没错,是我看错了
你帮忙把
select sj_Power.id,SJ_POWER.USERID,SJ_POWER.Place_ID,SJ_POWER.Part_ID,SJ_Place.S_place,SJ_Part.PartID
from SJ_POWER,SJ_PLACE,SJ_PART
where
sj_power.id=sj_part.id and sj_pwer.id=sj_part.id
这条语句添加个sj_user.suser='admin'的条件,显示效果和原来一样就可以了
谢谢!