just the
second SELECT.
> -Original Message-
> From: Hal?sz S?ndor [mailto:h...@tbbs.net]
> Sent: Thursday, June 21, 2012 4:07 PM
> To: mysql@lists.mysql.com
> Subject: UNION and ORDER BY
>
> >>>> 2012/06/20 14:32 -0700, Rick James >>>>
>
2012/06/20 14:32 -0700, Rick James
(
SELECT ruid1, ruid2, overlap FROM l4_link WHERE ruid1=xxx
UNION
SELECT ruid1, ruid2, overlap FROM l4_link WHERE ruid2=xxx
) ORDER BY overlap DESC;
Make it UNION ALL or UNION DISTINCT depending on whether xxx can be in both
fields of one row.
Neculai Macarie wrote:
>> To my observations constants in a column declaration limit the
>> column width to just fit the initial constant.
>> Your choice of values 'gallary' and 'gallery-categ' just masked that
>> out ;-)
> Yes, you are right. Based on your observation I was able to trick him
> wit
> Neculai Macarie wrote:
> []
> > select 'gallery' as table_name, d_image_small, d_image_big
> > from gallery
> > UNION
> > select 'gallery_categ' as table_name, d_image, NULL
> > from gallery_categ
> > order by table_name;
> []
> > select 'gallery' as table_name, d_image_small, d_image_big
> > fr
Neculai Macarie wrote:
[]
> select 'gallery' as table_name, d_image_small, d_image_big
> from gallery
> UNION
> select 'gallery_categ' as table_name, d_image, NULL
> from gallery_categ
> order by table_name;
[]
> select 'gallery' as table_name, d_image_small, d_image_big
> from gallery
> union
> se
Hi!
Using Union and Order By gives strange behaviour in the following test-case:
drop table if exists gallery;
drop table if exists gallery_categ;
# create test tables
create table gallery (d_image_small char(100), d_image_big char(100));
create table gallery_categ (d_image char(100));
# insert