Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3349942
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:43:36+00:00 2026-05-18T01:43:36+00:00

I want to perform an SQL update UPDATE incCustomer SET etaxCode = ‘HST’ WHERE

  • 0

I want to perform an SQL update

UPDATE  incCustomer SET etaxCode = 'HST' WHERE 

only on records where this is true.

select  etaxCode
from  incCustomer
left join incAddress on incCustomer.iAddressId = incAddress.iId
left join incProvince on incAddress.iProvinceStateId = incProvince.iId
where incAddress.iProvinceStateId in (     2  ,     3   ,      4   ,    6   ,   9 )

I don’t think that this is possible with ANSI SQL, but can it be done in MySQL?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:43:36+00:00Added an answer on May 18, 2026 at 1:43 am

    MySQL UPDATE syntax supports joins in both ANSI-89 and ANSI-92 syntax.

    Use:

       UPDATE INCCUSTOMER c
    LEFT JOIN INCADDRESS a ON a.iid = c.iaddressid
    LEFT JOIN INCPROVINCE p ON p.iid = a.iprovincestateid
          SET c.etaxcode = 'HST'
        WHERE a.iProvinceStateId IN (2,3,4,6,9)
    

    I don’t see the point of LEFT JOINing to the province table – I think your UPDATE could be written as:

       UPDATE INCCUSTOMER 
          SET c.etaxcode = 'HST'
        WHERE EXISTS(SELECT NULL
                       FROM INCADDRESS a
                      WHERE a.iid = INCCUSTOMER.iaddressid
                        AND a.iProvinceStateId IN (2,3,4,6,9))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to perform a LIKE-condition (SQL syntax) in CouchDB. How can this be
I have a sql query shown below i want to use the variables streetname,
I have a question about the fastest way to perform a SQL Server query
link text I want to use the TIFF IFilter built in to Windows 2008
In Rails 2.3.8 there is a class method ActiveRecord::Base.count_by_sql which allows to perform custom
in our company's product, we attach a database to SQL Server, and we need
I want to pass the sort field and direction dynamically to the LINQ to
In a SQL Server DB, I have a table of values that I am
Some co-workers and I got into a debate on the best way to store
I have the following django model (mapped to table 'A'): class A(models.Model): name =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.