[ic] sql query with UNION broken

Bill Carr bill at worldwideimpact.com
Fri Aug 22 13:48:32 EDT 2003


IC 4.9.8, MySQL 4.0.14, PERL 5.8

I am trying to do a SQL query using UNION. When I add parentheses around
each of my SELECT statements I do not get the full results. I only get
the values from the first column of the first row. I need the
parentheses because I would like to sort the results of the UNION.

This gives the desired results:
[query
        list=1
        sql=|
                SELECT 1,2
                UNION
                SELECT 3,4
                |
]
        [list]
                [sql-pos 0], [sql-pos 1]<br>
        [/list]
[/query]
Yields:
	1,2
	3,4

Adding parentheses breaks it:
[query
        list=1
        sql=|
                (SELECT 1,2)
                UNION
                (SELECT 3,4)
                |
]
        [list]
                [sql-pos 0], [sql-pos 1]<br>
        [/list]
[/query]
Yields:
	2,


Is this bug? Any ideas?

-- 
Bill Carr
Worldwide Impact
bill at worldwideimpact.com
413-253-6700



More information about the interchange-users mailing list