是不是很好的代碼?可以簡化一下嗎?ms-access簡化SQL代碼
SELECT u.id,u.title,u.title,u.first,u.last FROM
(((tblusers u LEFT JOIN tbluserstudentteacher
ON u.id = tbluserstudentteacher.student_teacher_user_id)
LEFT JOIN tblUsersSubjects ON u.id = tblUsersSubjects.user_id)
LEFT JOIN tblUserAvailability ON u.id=tblUserAvailability.user_id)
LEFT JOIN chavrusas ON u.id=chavrusas.luser_id
WHERE 1=1 AND (u.gender) LIKE 'm*'
AND (chavrusas.luser_type)='shliach'
AND (chavrusas.ruser_type)='shliach' AND (u.last LIKE 'd*')
GROUP BY u.id, u.title, u.title, u.first, u.last
ORDER BY last;
lol @ where 1 = 1 – JonH 2009-10-27 18:59:06
實際上這段代碼讓我想吐。誰寫它不知道什麼GROUP BY是或如何按照相關領域進行分組。 – JonH 2009-10-27 18:59:44
保持在一個地方......這就像在20分鐘內你的第10個問題? – Fredou 2009-10-27 19:00:01