Frank D. Engel, Jr. wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
SELECT file_name, 1 FROM file_info_1 WHERE file_parent_dir='/' UNION
SELECT file_name, 2 FROM file_info_2 WHERE file_parent_dir='/' UNION
SELECT file_name, 3 FROM file_info_3 WHERE file_parent_dir='/'
ORDER BY file_name;
The s
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
SELECT file_name, 1 FROM file_info_1 WHERE file_parent_dir='/' UNION
SELECT file_name, 2 FROM file_info_2 WHERE file_parent_dir='/' UNION
SELECT file_name, 3 FROM file_info_3 WHERE file_parent_dir='/'
ORDER BY file_name;
The second column now shows whic
On Mon, Jan 10, 2005 at 13:24:50 -0500,
Madison Kelly <[EMAIL PROTECTED]> wrote:
>
> ^.^; Can you point me to docs that will help me learn how to do that?
> Thanks! Or rather, do you mean add a column to the table with an ID for
> the table that I select beside the file_name? If so, that is wh
SELECT 'table1' AS source, file_name FROM file_info_1 WHERE
file_parent_dir='/'
UNION
SELECT 'table2' AS source, file_name FROM file_info_2 WHERE
file_parent_dir='/'
UNION
SELECT 'table3' AS source, file_name FROM file_info_3 WHERE
file_parent_dir='/' ORDER BY file_name;
On January 10, 2005
Bruno Wolff III wrote:
On Mon, Jan 10, 2005 at 12:47:53 -0500,
Madison Kelly <[EMAIL PROTECTED]> wrote:
The trick now is I need to know which table each result came from. I can
add another column and record the table number and SELECT that at the
same time but before I do I was wondering if I c
On Mon, Jan 10, 2005 at 12:47:53 -0500,
Madison Kelly <[EMAIL PROTECTED]> wrote:
>
> The trick now is I need to know which table each result came from. I can
> add another column and record the table number and SELECT that at the
> same time but before I do I was wondering if I can do this mor
Alex Turner wrote:
To be honest, it looks like you might need a schema adjustment.
Normalization means keeping one kind of thing in one place, avoiding
ugly queries. Inheritance can also help with this too.
Alex Turner
NetEconomist
Hi,
The schema started off with all the data in one place as y
On Mon, Jan 10, 2005 at 12:47:53PM -0500, Madison Kelly wrote:
Madison,
> The trick now is I need to know which table each result came from. I can
> add another column and record the table number and SELECT that at the
> same time but before I do I was wondering if I can do this more
> efficie
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
As for the first part, try this:
(SELECT file_name FROM file_info_1 WHERE file_name = '/') UNION
(SELECT file_name FROM file_info_2 WHERE file_parent_dir = '/') UNION
(SELECT file_name FROM file_info_3 WHERE file_parent_dir = '/')
As for sorting the com
Am Montag, 10. Januar 2005 18:22 schrieb Madison Kelly:
> Hi all,
>
>I have another question, I hope it isn't too basic. ^.^
>
>I want to do a select from multiple tables but not join them. What I
> am trying to do is something like this (though this doesn't work as I
> need):
>
> SELECT a.
John Sidney-Woollett wrote:
I hope I've read your question properly - I seem to be giving answers to
un-asked questions lately! ;)
How about...
SELECT file_name from file_info_1 WHERE file_name='/'
union
SELECT file_name from file_info_2 WHERE file_parent_name='/'
union
SELECT file_name from file
On Mon, Jan 10, 2005 at 12:22:41PM -0500, Madison Kelly wrote:
> What I need is to return all of the matches in all of the tables
> in a single column.
Maybe you're looking for UNION -- see the "Combining Queries" section
in the "Queries" chapter of the documentation.
--
Michael Fuhr
http://www
To be honest, it looks like you might need a schema adjustment.
Normalization means keeping one kind of thing in one place, avoiding
ugly queries. Inheritance can also help with this too.
Alex Turner
NetEconomist
On Mon, 10 Jan 2005 12:22:41 -0500, Madison Kelly <[EMAIL PROTECTED]> wrote:
> Hi
Typo, that should have been:
SELECT a.file_name, b.file_name, c.file_name FROM file_info_1 a,
file_info_2 b, file_info_3 c WHERE a.file_parent_dir='/' AND
b.file_parent_dir='/' AND c.file_parent_dir='/';
(All the WHERE... are the same)
Madison
Madison Kelly wrote:
Hi all,
I have another questi
I hope I've read your question properly - I seem to be giving answers to
un-asked questions lately! ;)
How about...
SELECT file_name from file_info_1 WHERE file_name='/'
union
SELECT file_name from file_info_2 WHERE file_parent_name='/'
union
SELECT file_name from file_info_3 WHERE file_parent_na
Hi all,
I have another question, I hope it isn't too basic. ^.^
I want to do a select from multiple tables but not join them. What I
am trying to do is something like this (though this doesn't work as I need):
SELECT a.file_name, b.file_name, c.file_name FROM file_info_1 a,
file_info_2 b, fi
16 matches
Mail list logo