Unix Technical Forum

Re: union subqueries in

This is a discussion on Re: union subqueries in within the Informix forums, part of the Database Server Software category; --> Try: select * from table( multiset( select * from <your-table> ) ) ; -----Original Message----- From: "Dan" <bubba@dekworld.com> To: ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 09:19 AM
Jean Sagi
 
Posts: n/a
Default Re: union subqueries in



Try:

select *
from table( multiset( select * from <your-table> ) )
;


-----Original Message-----
From: "Dan" <bubba@dekworld.com>
To: informix-list@iiug.org
Date: Fri, 13 May 2005 10:34:44 -0400
Subject: union subqueries in "from" clause (IDS 9.4)

Hi. The SQL Syntax Guide claims that the subject queries are supported.
(Ref:
http://publib.boulder.ibm.com/infoce...oc/sqls697.htm)

E.g. for a simple table like...

CREATE TABLE utest (
q INTEGER NOT NULL,
w CHAR(1) NOT NULL,
v INTEGER NOT NULL,
PRIMARY KEY (q,w)
);

....I would expect that the following would work

select q, sum(v) from (select q,v from utest where w='a' union all
select q,v from utest where w='b') group by q;

But instead it produces a "syntax error" pointing to the 2nd "v" (from the
left, column 32).

Any ideas on why I can't get this to work?




Jean Sagi
jeansagi@myrealbox.com
jeansagi@gmail.com

sending to informix-list
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com