Advertisement

05.23.2003 at 01:45PM PDT, ID: 20624895
[x]
Attachment Details

SQL query not working

Asked by mts9 in ColdFusion Application Server

Tags: , ,

Hi All,

I'm trying to do a rather complex comparison/update on my data and I'm looking to do it with 1 query. Basically, I have 2 tables. Table "A" contains accnt_id_1, accnt_id_2 and accnt_hold_flag. Table "B" is a validation table containing accnt_id_1 and accnt_id_2. I would like to update all the accnt_hold_flag flags in table "A" to "X" where accnt_id's 1 & 2 do not exist in table "B". Here is what I got so far...

UPDATE A
LEFT OUTER JOIN B ON (A.accnt_id_2 = B.accnt_id_2 ) AND (A.accnt_id_1 = B.accnt_id_1)
SET accnt_hold_flag = 'X'
WHERE B.accnt_id_1 Is Null
AND B.accnt_id_2 Is Null

CF doesn't seam to like "LEFT".

And for the bonus question (I will award an extra 150 for this)...if accnt_id_2 is equal to "1001M" or "1001X", I would like to convert it to "10010" before the validation check. I don't want to update the actual data just validate against "10010".

Thanks in advance. I have to go away so I might not get to reward the response until Monday morning.

MikeStart Free Trial
[+][-]05.23.2003 at 02:52PM PDT, ID: 8575064

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

Zone: ColdFusion Application Server
Tags: query, sql, working
Sign Up Now!
Solution Provided By: TallerMike
Participating Experts: 3
Solution Grade: A
 
 
[+][-]05.23.2003 at 03:04PM PDT, ID: 8575125

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.

 
[+][-]05.23.2003 at 08:05PM PDT, ID: 8575913

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.

 
[+][-]05.25.2003 at 08:58PM PDT, ID: 8582220

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.

 
[+][-]05.27.2003 at 06:50AM PDT, ID: 8590234

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.

 
[+][-]05.27.2003 at 07:53AM PDT, ID: 8590694

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.

 
[+][-]05.27.2003 at 09:06AM PDT, ID: 8591337

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.

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