7806_devToTest_2332 #2801

Merged
alexm merged 126 commits from 7806_devToTest_2330 into test 2024-07-30 06:14:09 +00:00
1 changed files with 3 additions and 4 deletions
Showing only changes of commit 5567359d73 - Show all commits

View File

@ -1,5 +1,5 @@
ALTER TABLE bs.waste ADD buyerFk int(10) unsigned NOT NULL;
USE vn;
CREATE OR REPLACE TEMPORARY TABLE tBuyers
ENGINE = MEMORY
WITH tDistinctBuyers AS (
@ -8,8 +8,7 @@ CREATE OR REPLACE TEMPORARY TABLE tBuyers
)
SELECT buyer, u.id
FROM tDistinctBuyers tdb
JOIN account.`user` u ON u.name = tdb.buyer COLLATE utf8mb3_unicode_ci
JOIN account.`user` u ON u.name = tdb.buyer COLLATE utf8mb3_unicode_ci;
UPDATE bs.waste w
JOIN tBuyers tb ON tb.buyer = w.buyer
@ -51,4 +50,4 @@ INSERT INTO bs.waste
ALTER TABLE bs.waste ADD CONSTRAINT waste_pk PRIMARY KEY (`year`, `week`, buyerFk, itemTypeFk, itemFk);
DROP TEMPORARY TABLE tBuyers, tWasteUnique;
DROP TEMPORARY TABLE tWasteUnique;