关闭

php-多表查询 语句

标签: loginc
1799人阅读 评论(2) 收藏 举报
分类:

-- 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'

 

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

 


 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:30465次
    • 积分:1013
    • 等级:
    • 排名:千里之外
    • 原创:78篇
    • 转载:0篇
    • 译文:0篇
    • 评论:7条
    文章分类
    最新评论