Join the tables together so they are treated like a single table...(assuming
they are join-able)
SELECT c.categoryid, sc.sub_CategoryId
FROM categories c, sub_category sc
WHERE c.categoryID = sc.categoryID AND (c.category = '#form.searchVal#' OR
sc.sub_Category =
'#form.searchVal#')
LIMIT 1
+
Cheers Matt,
Worked a charm
>I have two tables which I want to query at the same time. I'm thinking
>something along the lines of
>
>SELECT c.categoryid, sc.sub_CategoryId
>FROM categories c, sub_category sc
>WHERE c.category = '#form.searchVal#' OR sc.sub_Category =
>'#form.searchVal#'
>LIMIT
Have you tried union?
SELECT.
UNION
SELECT.
_
From: Andy J [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 10 August 2004 11:22 a.m.
To: CF-Talk
Subject: Is this possible in SQL
I have two tables which I want to query at the same time. I'm thinking
something along the lines of
SELECT c.ca
3 matches
Mail list logo