I have 2 tables which I join this way:
UPDATE wm_rendi rendi JOIN wm_acquisti ON rendi.isrc_isbn = wm_acquisti.barcode SET rendi.user_id = wm_acquisti.user_id WHERE rendi.user_id IS NULL
This query takes 24 ho hours to complete...
This is the wm_acquisti
table, with +18'000 records:
USER_ID BARCODE
12 600001
56 500003
12 600007
12 800018
32 100004
56 500007
... ...
This is the wm_rendi
table, with 910'040 records up to now:
USER_ID ISRC_ISBN
NULL 600001
NULL 500003
... ...
So, because of the loooooong taking of this query, I thought I could shorten the wm_acquisti
this way:
USER_ID BARCODE
12 600001|600007|800018
56 500003|500007
32 100004
The point is that I have to join these two tables based on the barcode, but it takes waaaay to long.
Is there a way of obtaining the same join using the shorter table (pipe separated barcodes) or any other method?