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
> 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 ...
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 :-)
MySQL Development Team
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, http://www.mysql.com/
/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany