Umair Mubeen:
私は、その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に等しい、データベース内のデータを表示したいです
任意の助けを事前に感謝をいただければ幸いです
Koteswaraラオ:
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
現在のAS tbl_useraccounts FROM
LEFTは、上の親としてtbl_useraccountsを登録しよう
parent.ParentUserAccountID = Current.UserAccountID
INNERはCurrent.ClientID =上tbl_clientsを登録しよう
tbl_clients.ClientID
WHERE Current.UserID = '7'
そしてCurrent.Status!= '2'
そしてparent.ParentUserAccountID!= ''
そしてparent.Implementation_Type = '4'
parent.LastModifiedDate descvによって順