我尝试过: SELECT tbl_controls。 ControlName,tbl_link.Status FROM tbl_controls left outer JOIN tbl_link ON tbl_controls .C_ID = tbl_link .C_ID WHERE(tbl_link.Status IN (SELECT Status FROM tbl_link AS tbl_link_1 WHERE(UserID = 30))) 解决方案 我不确定我是否理解你,但是。 ..试试这个: SELECT TC.ControlName,TL.Status FROM tbl_link AS TL INNER JOIN tbl_user AS TU ON TL.UserID = TU.UserID INNER JOIN tbl_controls AS TC ON TL.C_ID = TC.C_ID WHERE TL.USerId = 30 有关详细信息,请参阅: SQL联接的可视化表示 [ ^ ] I have three table [tbl_user, tbl_controls, tbl_link], tbl_userUserIDUserNametbl_controlsC_IDControlNametbl_linklk_idUserIDC_IDStatus (bit)the control is placed in the tbl_control, and assign control status is placed in tbl_link, I want to load app control in a grid view but the relevant status is marked tick by the reference of UserID. How i accomplished this.THanksRegardsWhat I have tried:SELECT tbl_controls.ControlName, tbl_link.StatusFROM tbl_controls left outer JOIN tbl_link ON tbl_controls .C_ID= tbl_link .C_IDWHERE (tbl_link.Status IN (SELECT Status FROM tbl_link AS tbl_link_1 WHERE (UserID= 30))) 解决方案 I'm not sure i understand you well, but... try this:SELECT TC.ControlName, TL.StatusFROM tbl_link AS TL INNER JOIN tbl_user AS TU ON TL.UserID = TU.UserID INNER JOIN tbl_controls AS TC ON TL.C_ID = TC.C_IDWHERE TL.USerId =30For further details, please see: Visual Representation of SQL Joins[^] 这篇关于如何从链表上的不同表中获取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-29 23:46