Update query with Inner join

mdmatiullah

New member
Local time
Today, 21:13
Joined
Jun 15, 2011
Messages
6
Hi,
I have two tables named DOH1 and Alignment , want to update DOH1.whse_nbr based on condition DOH1.STORE_NBR=ALIGNMENT.STORE_NBR AND DOH1.WHSE_TYPE=ALIGNMENT.WHSE_TYPE
I am writing this query using Inner join

UPDATE DOH1 INNER JOIN ALIGNMENT ON (DOH1.STORE_NBR=ALIGNMENT.STORE_NBR AND DOH1.WHSE_TYPE=ALIGNMENT.WHSE_TYPE) SET DOH1.whse_nbr=ALIGNMENT.whse_nbr WHERE (DOH1.STORE_NBR=ALIGNMENT.STORE_NBR AND DOH1.WHSE_TYPE=ALIGNMENT.WHSE_TYPE)

Inner join taking 5 minutes to update around 4,000,00 rows, I want alternate of inner join to execute this query faster.
 
Last edited:
Are whse_type and store_nbr indexed? If not then put an index on them. Update: Hmm I guess they are , since you join on them, so I don't know.

And remember that not all know that a lakh is 100,000
 
Yes whse_type and store_nbr are indexed.
 

Users who are viewing this thread

Back
Top Bottom