php-多表查询 语句

-- select * from yonghu where login_name='lhp' and login_pwd='123'
-- select * from juese


-- select * from yonghu  where yonghu_id=1
--select juese_id from juese  where  juese_id=2
-- select * from juese where juese_id in(
  --     select juese_id from yonghu_juese  where  yonghu_id=
  --              (select yonghu_id  from yonghu where login_name='lhp' and login_pwd='123')      

 --       )        

  -- select * from yonghu
-- select * from yonghu where login_name='lhp' and login_pwd='123'
-- select * from juese
--select juese_id from yonghu_juese where yonghu_id=1
--select * from juese where juese_id=2

select * from juese
       where juese_id  in(
       select juese_id from yonghu_juese
              where yonghu_id=(
                    select yonghu_id from yonghu where login_name='cx' and login_pwd='456'
              )
       )      

 

 

select * from juese j,juese_quanxian jq ,quanxian q
       where j.juese_id=jq.juese_id and jq.quanxian_id=q.quanxian_id

select * from juese j ,juese_quanxian jq, quanxuan q where j.juese_id=jq.juese_id and jq.quanxian_id=q.quanxuan_id


select * from quanxuan q,quanxian_caidan qc,caidan c
       where q.quanxuan_id=qc.quanxian_id and qc.caidan_id=c.caidan_id      

 

select y.*,c.* from
       yonghu y,yonghu_juese yj,juese j      
       ,juese_quanxian jq ,quanxuan q      
       ,quanxian_caidan qc,caidan c
        where y.yonghu_id=yj.yonghu_id and yj.juese_id=j.juese_id
        and j.juese_id=jq.juese_id and jq.quanxian_id=q.quanxuan_id        
        and q.quanxuan_id=qc.quanxian_id and qc.caidan_id=c.caidan_id       
        and y.login_name='lhp' and y.login_pwd='123'

 

 

 

select * from v_yonghu_caidan where login_name='jzs' and login_pwd='789'

 

 吧这写语句放这里---用的时好找-----------------------------

 


 

阅读更多
文章标签: login c
个人分类: php日记
上一篇Java------ 自己的东西- --数据类型啦
下一篇Java——接口的理解
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭