drop table if exists test.flipdata;
create table test.flipdata (f1 int,f2 char(1),f3 char(1));
insert into test.flipdata values (1,'a','b'),(2,'c','d');
create view test.RotatedData as select f1,f2 from test.flipdata union select 
f1,f3 from test.flipdata order by 1;
select * from test.RotatedData;

----- Original Message -----
From: "Stefan Kuhn" <[EMAIL PROTECTED]>
To: "MySQL" <mysql@lists.mysql.com>
Sent: Monday, July 16, 2007 8:58:58 AM (GMT-0500) America/New_York
Subject: Putting two queries in one

Hi all,
I have to create a view. For this, a table needs to transformed like this:
So the original table is
1 a b
2 c d
I want
1 a
1 b
2 c
2 d
I can do two queries giving me this, but how do I combine them in a view? If a 
new table would need to be created, I could do a select into - but in a view? 
It would need to be done in one query, if I understood it right.
Anybody an idea?
Thanks,
Stefan
-- 
Stefan Kuhn BSc MA
IPB Halle
AG Bioinformatik & Massenspektrometrie
Weinberg 3
06120 Halle
http://www.ipb-halle.de http://msbi.bic-gh.de
[EMAIL PROTECTED] +49 (0) 345 5582 1474 Fax.+49 (0) 345 5582 1409

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to