Do you have a question? Post it now! No Registration Necessary. Now with pictures!
December 29, 2005, 3:08 am
rate this thread
I´m stuck with a problem
I have to make a table with the information of three different queries.
The table has 4 columns x n rows. The first and second columns must be
filled with the result of the first query, the third, with the result
of the second query and the fourth with the result of the third query.
All queries has the same number of results and the count(result) > 1
I made different combinations of while's but no one seems to work.
Any help or reference???
Thanks in advance!!!
Re: Table with 3 queries
How are you associating different rows of the separate queries?
e.g. if Query 1 gives:
and Query 2 gives:
and Query 3 gives:
How do you expect MySQL (are you using MySQL? You didn't actually say)
to know how to combine these into one table?
There's nothing about that data that implies it should be combined as
col1 col2 col3 col4
A X D G
B Y E H
C Z F I
In which case, it's usually the wrong approach to put unrelated data
into one table.
If the data *is* related in some way, then that means that you should be
able to perform just one query, rather than three separate queries.