From: Tompkins Neil Date: August 25 2010 2:02pm Subject: Re: Retrieve three columns in sub query List-Archive: http://lists.mysql.com/mysql/222673 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=00c09f8a4d8c798e4e048ea655c3 --00c09f8a4d8c798e4e048ea655c3 Content-Type: text/plain; charset=ISO-8859-1 Hi M, This appears to do exactly what I require. Thank you ! Cheers Neil On Wed, Aug 25, 2010 at 1:43 PM, misiaQ wrote: > select ci.*, ct.* from (select name, countrycode from city) ci, country ct > where ci.countrycode = ct.code > > Regards, > m > > -----Original Message----- > From: Tompkins Neil [mailto:neil.tompkins@stripped] > Sent: Wednesday, August 25, 2010 1:23 PM > To: [MySQL] > Subject: Retrieve three columns in sub query > > Hi > > Is it possible in MySQL 5.1 to retrieve three columns in a select sub-query > like below : > > SELECT student_age, SELECT (student_subjects_id, random_mark, subject FROM > student_subjects ORDER BY RAND(), LIMIT 1) > FROM students > WHERE student_age > 10 > ORDER BY RAND() > LIMIT 1 > > I've looked and tried everything, but nothing seems to work... > > Cheers > Neil > > > ---------------------------------------------------------------------- > Kup wlasne mieszkanie za 72 tys. zl. > Sprawdz najlepsze oferty >>> http://linkint.pl/f27c4 > > --00c09f8a4d8c798e4e048ea655c3--