Hi!

On Nov 18, boris hajduk wrote:
> SG> Correction - this one is wrong, it will list each entry only once.
> 
> confirmed :)
> 
> 
> >> SELECT position1 as position,title WHERE position1 IN ($_) UNION
> >> SELECT position2 as position,title WHERE position2 IN ($_) ORDER BY position;
> SG> This one is ok.
> 
> what about a way that would work with 3.23 ? :))

If you're using Perl anyway, then do it with two selects and sort in
perl. 200 lines is nothing for perl.

Or you can emulate UNION with temporary table.

  CREATE TEMPORARY xxx SELECT ...
  INSERT xxx SELECT ...
  SELECT xxx ...

Or...

  CREATE TABLE nums (position INT UNSIGNED NOT NULL AUTO_INCREMENT);

fill it with 1..200 (you can do it only once, of course) and

  SELECT position,title FROM nums,books WHERE position1=position OR
                 position2=position ORDER BY position;

> (ah, damn real-life admins, who don't want to upgrade before 6 months
> of proven reliability)

I can understand that :-)

Regards,
Sergei

-- 
MySQL Development Team
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
       <___/

---------------------------------------------------------------------
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

Reply via email to