Advertisement

10.22.2007 at 03:29AM PDT, ID: 22908574
[x]
Attachment Details

SQL Statement using WHERE

Asked by cybeh in MySQL, Visual Basic Programming

Tags: sql, from

Hi,

I need to do some sql statement like below

SELECT '1' AS Count, primaryID from tbl1
UNION
SELECT '2' AS Count, PrimaryID from tbl2

this SQL statement work fine, but, when I try to do something like this
(SELECT '1' AS Count, primaryID from tbl1
UNION
SELECT '2' AS Count, PrimaryID from tbl2)
WHERE Count = '2'

it give me error that column not found.

Please advice.
Start Free Trial
[+][-]10.22.2007 at 03:34AM PDT, ID: 20122036

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MySQL, Visual Basic Programming
Tags: sql, from
Sign Up Now!
Solution Provided By: hernst42
Participating Experts: 5
Solution Grade: A
 
 
[+][-]10.22.2007 at 03:35AM PDT, ID: 20122037

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.22.2007 at 04:00AM PDT, ID: 20122146

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.22.2007 at 04:02AM PDT, ID: 20122154

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.22.2007 at 04:21AM PDT, ID: 20122241

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.22.2007 at 06:39AM PDT, ID: 20122990

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.22.2007 at 07:06AM PDT, ID: 20123218

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628