SELECT `a`.`UNIQ_CODE`, `b`.`JUDUL_BERITA`, `b`.`THUMNAIL`, `c`.`NAMA`,
`a`.`TAG`, `a`.`CREATED_DATE`, `a`.`GLOBAL`, `a`.`VERIFIKASI`
FROM (`q_master_berita` a)
JOIN `q_master_berita` a ON `b`.`UNIQ_CODE` = `a`.`UNIQ_CODE`
RIGHT JOIN `q_daftar_user` c ON `a`.`ID_UPLOADER` = `c`.`ID`
WHERE ( a.FLAG = 'DRAFT' AND a.ID_SEKOLAH = '3824' )
ORDER BY `b`.`JUDUL_BERITA` asc
LIMIT 10
不知何故,它说
Not unique table/alias: 'a'
答案 0 :(得分:0)
那是因为你对表q_master_berita使用了两次相同的别名。您需要使用不同的别名。
SELECT `a`.`UNIQ_CODE`, `b`.`JUDUL_BERITA`, `b`.`THUMNAIL`, `c`.`NAMA`,
`a`.`TAG`, `a`.`CREATED_DATE`, `a`.`GLOBAL`, `a`.`VERIFIKASI`
FROM (`q_master_berita` a)
JOIN `q_master_berita` b ON `b`.`UNIQ_CODE` = `a`.`UNIQ_CODE`
RIGHT JOIN `q_daftar_user` c ON `a`.`ID_UPLOADER` = `c`.`ID`
WHERE ( a.FLAG = 'DRAFT' AND a.ID_SEKOLAH = '3824' )
ORDER BY `b`.`JUDUL_BERITA` asc
LIMIT 10