I thought sub-select is a 4.x feature..
---------- Frank Peavy <[EMAIL PROTECTED]> writes: Return-Path: <[EMAIL PROTECTED]> Received: from mx6.nyc.untd.com (mx6.nyc.untd.com [10.140.24.66]) by maildeliver03.nyc.untd.com with SMTP id AAA9DBZJZAVXT492 for <[EMAIL PROTECTED]> (sender <[EMAIL PROTECTED]>); Fri, 24 Jan 2003 01:28:39 -0500 (EST) Received: from web.mysql.com (web.mysql.com [213.136.49.183]) by mx6.nyc.untd.com with SMTP id AAA9DBZJZAEVS6MS for <[EMAIL PROTECTED]> (sender <[EMAIL PROTECTED]>); Fri, 24 Jan 2003 01:28:39 -0500 (EST) Received: (qmail 15275 invoked by uid 7797); 24 Jan 2003 00:25:19 -0000 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm (http://www.ezmlm.org) List-ID: <mysql.mysql.com> Precedence: bulk List-Help: <mailto:[EMAIL PROTECTED]> List-Unsubscribe: <mailto:[EMAIL PROTECTED]> List-Post: <mailto:[EMAIL PROTECTED]> List-Subscribe: <mailto:[EMAIL PROTECTED]> Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 15255 invoked from network); 24 Jan 2003 00:25:18 -0000 Message-Id: <[EMAIL PROTECTED]> X-Sender: [EMAIL PROTECTED] X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 23 Jan 2003 16:24:11 -0800 To: "Doug Coning" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> From: Frank Peavy <[EMAIL PROTECTED]> Subject: Re: Is this possible? In-Reply-To: <023f01c2c313$5a2feb40$0a01a8c0@GIDEON> References: <[EMAIL PROTECTED]> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed I believe a sub-select with the DISTINCT command would do it. You would have to look up the syntax. Also, it seems that some people seem to be having a problem with sub-selects but I don't have any direct experience to convey. At 01:12 PM 1/23/03 -0600, Doug Coning wrote: >Is this possible in MySQL without using a temporary table with multiple SQL >commands: > >I am trying to SELECT the results of multiple columns into 1 column or >Alias, >group them and sort them. > >So if I had a table with 4 fields: Cat1, Cat2, Cat3, & Cat4 like such: > >+-----+------+-----+------+ >| Cat1| Cat2 | Cat3| Cat4 | >+-----+------+-----+------+ >| F | A | | A | >| D | C | H | A | >| G | | | | >| F | B | I | A | >+-----+------+-----+------+ > >It would select all the values, merge them into 1 column, group them, and >sort them like such so that the result would be a single column, returning >only 1 instance of each returned value: > >+--------+ >| Result | >+--------+ >| A | >| B | >| C | >| D | >| F | >| G | >| H | >| I | >+--------+ > >Is there as singe Select command that can do this? Right now I am using a >temporary table where I first clear out the values, then copy each column >one at a time over into the tables... It works, however, I was wondering if >there is an easier way to get the single column result with all the merged >information without having to use a temporary table... > >Thanks, > >Doug Coning > > > > > >--------------------------------------------------------------------- >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 --------------------------------------------------------------------- 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 --------------------------------------------------------------------- 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