#-- This whole file was just an attempt to rebuild queries because I was getting duplicate entries for the queries, both in the admin php and the servlet code, for the display of scheduled presentations. Turned out it was really because there were duplicate entries (i.e. records with the same user id) in the user table. #This works, but duplication has already appeared select spkr_name, pre_date, ses_period, ses_start from speaker, presentation, session where pre_spkr_id = spkr_u_id and pre_ses_id = ses_id and pre_scl_id = ses_scl_id order by pre_date #-- this works with no duplication,but doesn't get speaker name: select pre_date, pre_spkr_id, ses_period, ses_start from presentation, session where pre_ses_id = ses_id and pre_scl_id = ses_scl_id order by pre_date; #... adding teacher name: select spkr_name, pre_date, ses_start, tchr_name from speaker, presentation, session, teacher where pre_spkr_id = spkr_u_id and pre_ses_id = ses_id and pre_scl_id = ses_scl_id and pre_tchr_id = tchr_u_id #.. adding room and subject: this is where the duplication occurs # if I use "select distinct" it works fine. select spkr_name, pre_date, ses_start, tchr_name, tp_subject, tp_room from speaker, presentation, session, teacher, teacherperiod where pre_spkr_id = spkr_u_id and pre_ses_id = ses_id and pre_scl_id = ses_scl_id and pre_tchr_id = tchr_u_id and pre_tchr_id = tp_tchr_id and ses_period = tp_period order by pre_date ; #attempt at simple duplication: presentation, session, and tp_period This produces a huge long list. select pre_date, ses_start, tp_subject, tp_room from presentation, session, teacherperiod where pre_ses_id = ses_id and pre_ses_id = ses_id and pre_scl_id = ses_scl_id and ses_period = tp_period order by pre_date ;