RE: Is this possible in SQL

2004-08-12 Thread Bryan Love
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

Re: Is this possible in SQL

2004-08-10 Thread Andy Jarrett
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 1 But

RE: Is this possible in SQL

2004-08-09 Thread Matthew Walker
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