Nick de Voil writes: > I am running MySQL 3.23 on Windows 2000. > > I have a SQL statement which looks fine to me, although it does reference > the same table twice. > > Here it is: > > SELECT DISTINCT u.inserted_usr_id, g.inserted_ugp_id FROM raw_users u, > raw_data d, raw_groups g, raw_groups gg WHERE u.forename = d.forename AND > u.surname = d.surname AND g.group_name = CONCAT(d.subject,' ',d.set_name) > AND d.yr_and_reg = gg.group_name AND gg.parent_ugp_id = g.parent_ugp_id; > > When I try to run this, either from the Java servlet where it lives, or just > via the mysql command line, my PC goes into a tailspin. > > Does MySQL not support aliasing the same table twice in one SQL statement? > > Thanks > > Nick >
Hi! MySQL allows as many aliases as there could be tables in the join. Look for the tailspin somewhere else ... Try executing the above query from mysql.exe program. -- Regards, __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus <___/ www.mysql.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php