You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ru...@icollector.com on 2000/12/05 10:36:59 UTC

RE: Simple question about tables [OT]

Sounds like you want a union query...

SELECT something, something_else FROM table1
UNION
SELECT something, something_else FROM table2

I think some databases are pickier than others about each pair of fields
being of the same datatype; Oracle requires each field to return the same
number of fields, while I seem to recall MS Jet doesn't... For mismatched
numbers of columns, do something like:

SELECT something, '' FROM table1
UNION
SELECT something, something_else FROM table2

If it's fussy about datatypes, using '', 0, null, sysdate, to_char() or
similar things to match the datatypes of the corresponding fields should
keep it happy...

hth
Rufus.

-----Original Message-----
From: bari [mailto:bari@sonicbox.com]
Sent: Monday, December 04, 2000 10:57 PM
To: modperl@apache.org
Subject: Simple question about tables


Hi there,
I have two query's both have same # or rows as out put but have different
columns. Like the first query gives me like 4 columns and the second query
gives me 1 column as out put.. Now I want to club the results of both the
queries so that the resulting table is 5 rows.
I am able to display the result of each query in separate table.. Like I am
able to display the result of first query which is 4 columns in one table.
and the result of second query with one column as separate table.  but I am
not able to add the an extra column to first query so that it gives me an
option to display result of the second query.
it would be great if any one can help me.

							Thank You

-bari


---------------------------------------------------------------------
To unsubscribe, e-mail: modperl-unsubscribe@apache.org
For additional commands, e-mail: modperl-help@apache.org