我要从UserAccountID与ParentUserAccount ID匹配的数据库中获取数据,>
这里是Sql查询
SELECT Current.Status, Current.UserID as UserID, Current.UserAccountID as C_UserAccID, Current.Implementation_Type as C_ImpType, Current.ClientID as C_ClientID, tbl_clients.ClientName, parent.LastModifiedDate as PLastModifiedDate, parent.ParentUserAccountID as PUserAccID, parent.Implementation_Type as PImpType, parent.IterationNum as PIterationNum, parent.Description as PDescription, parent.GSheetID as PGSheetID FROM tbl_useraccounts AS Current JOIN tbl_useraccounts AS parent on parent.ParentUserAccountID=Current.UserAccountID INNER JOIN tbl_clients on Current.ClientID = tbl_clients.ClientID WHERE Current.UserID ='7' and Current.Status!='2' and parent.ParentUserAccountID!='' and parent.Implementation_Type='4' order by parent.LastModifiedDate desc
但是我也想显示数据库中C_UserAccID不等于PUserAccountID的数据
提前感谢您的任何帮助
我想从UserAccountID与ParentUserAccount ID匹配的数据库中获取数据,这是SQL查询SELECT Current.Status,Current.UserID作为UserID,Current...。
Current.UserID as UserID,
Current.UserAccountID as C_UserAccID,
Current.Implementation_Type as C_ImpType,
Current.ClientID as C_ClientID,
tbl_clients.ClientName,
parent.LastModifiedDate as PLastModifiedDate,
parent.ParentUserAccountID as PUserAccID,
parent.Implementation_Type as PImpType,
parent.IterationNum as PIterationNum,
parent.Description as PDescription,
parent.GSheetID as PGSheetID