Is there any wrong code with my query to join table?

后端 未结 3 900
逝去的感伤
逝去的感伤 2021-01-26 06:28

I am really confused with this codes. I have query like this

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `aIPK` AS select 
`i         


        
3条回答
  •  猫巷女王i
    2021-01-26 07:13

    you have mistake in your description,

    your tables are

    table 1: akdhis_mahasiswamagister (ID, MahasiswaID, NIM, MayorID, TahunMasuk) table 2: akdmst_mayor(ID, DepartemenID) table 3: ipbmst_departemen(ID, FakultasID, DepartmenName) table 4: ipbmst_fakultas(ID, FacultyName) table 5: ipbmst_orang(ID, Name, NIMS2Key) table 6: akdhis_kelanjutanstudi(ID, NIM, IPK)

    but i dont see "akdhis_mahasiswamagister" table in your select

    CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECURITY DEFINER VIEW aIPK AS select ipbmst_fakultas.Kode AS Fakultas, ipbmst_departemen.Kode AS Departemen, akdmst_mahasiswamagister.NIM AS NIM, akdmst_mahasiswamagister.TahunMasuk AS TahunMasuk, akdhis_kelanjutanstudi.IPK AS IPK from (((((akdmst_mahasiswamagister inner join akdmst_mayor on((akdmst_mahasiswamagister.MayorID = akdmst_mayor.ID))) inner join ipbmst_departemen on((akdmst_mayor.DepartemenID = ipbmst_departemen.ID))) inner join ipbmst_fakultas on((ipbmst_departemen.FakultasID = ipbmst_fakultas.ID))) inner join ipbmst_orang on((akdmst_mahasiswamagister.NIM = ipbmst_orang.NIMS2Key))) inner join akdhis_kelanjutanstudi on((akdhis_kelanjutanstudi.NIM = ipbmst_orang.NIMS2Key))) WHERE IPK IS NOT NULL

    order by NIM LIMIT 100;

    akdhis_mahasiswamagister and akdmst_mahasiswamagister are different? may you are using wrong table, and so you have incorrect information

提交回复
热议问题