mysql基本操作【重要】

 

 

 

补充:

连接查询的例子:参考:  http://www.cnblogs.com/qlqwjy/p/7837529.html

1.三个表的显示内连接:

SELECT
  a.*,
  b.*,
  c.*
FROM exampaper a
  INNER JOIN bigquestion b
  INNER JOIN exampaperquestion c
    ON a.paperId = b.paperId
      AND b.bigQuertionId = c.bigQuertionId

 

2.两个表的显示内连接

SELECT a.*,b.* FROM a INNER JOIN b ON a.age=b.ageB

 

3.将查到的数据作为一个虚表连接查询:

mysql> select id,name from user inner join (select class_id from class where cal
ss_name='3') as c on c.class_id=user.class_id;

 

 

  

 

posted @ 2017-08-06 10:23  QiaoZhi  阅读(236)  评论(0编辑  收藏  举报