這將不顯示結果使用內部連接
SELECT IMSLogin.AccountType, IMSLogin.Status, Registration.UsrFLname, Registration.UsrEmail, Employee.EMPID, Students.STUID, Employee.EMPDEPT, Franchise.FrArea, Franchise.FrName
FROM Registration
INNER JOIN IMSLogin ON Registration.RegId = IMSLogin.RegId
INNER JOIN Employee ON Registration.RegId = Employee.RegId
INNER JOIN Students ON Registration.RegId = Students.RegId
INNER JOIN Franchise ON Registration.RegId = Franchise.RegId
但是,如果我在下面給出,將給予正確的結果
SELECT Registration.UsrFLname, Registration.UsrEmail, Students.STUID, Students.Pay_type, IMSLogin.AccountType, IMSLogin.Status
FROM IMSLogin
INNER JOIN Registration ON IMSLogin.RegId = Registration.RegId
INNER JOIN Students ON Registration.RegId = Students.RegId
我的表選擇從多個表中的SQL Server不同領域:
Registration(RegId,PK)
IMSLogin(RegId, FK)
Students(RegId,FK)
Franchise(RegId,FK)
Employee(RegID,FK)
我想在gridview中顯示它,但我需要正確的查詢,我不知道如何使用inne r加入?
plz幫助....
謝謝...
檢查你的員工和特許經營加盟。您可能需要一些左連接。 –
@kostasch。是的,這是問題....我給所有的左連接,而不是內心.......謝謝你..... – user72
不客氣。 :) –