用欄位的完全限定名:表名.欄位名tablename.fieldname。
- 情感問答
- 答案列表
mysql外鍵查詢:mysql資料庫多表聯查[朗讀]
selecta.id,b.id,c.idfromaleftjoinbona.bid=b.idleftjoincona.cid=c.id。
現有兩個表table1和table2,id相同,均為主鍵,也就是外鍵selecta.*,b.*fromtable1asa,table2asbwherea.*=b.*anda.*=*把*換成你的條件--#完了。
selectt.book_typefromt_bookb,t_book_typetwhereb.type_id_fk=t.typeid。
加入收藏