Need small help in mariadb multi column update -- 2
₹600-1500 INR
Concluído
Publicado há mais de 3 anos
₹600-1500 INR
Pago na entrega
I want to update multiple columns 2 or 3 in one table using 2 sums from another table where date is equal. in mariadb
UPDATE customers
SET amount,price= (SELECT sum(amt),sum(price)
FROM suppliers
WHERE suppliers.customer_name = customers.customer_name)
WHERE customer_id > 5;
CREATE TABLE `customers` (
`customer_name` VARCHAR(50) NULL DEFAULT NULL,
`amount` INT(11) NULL DEFAULT NULL,
`price` INT(11) NULL DEFAULT NULL
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;
CREATE TABLE `suppliers` (
`customer_name` VARCHAR(50) NULL DEFAULT NULL,
`supplier_name` VARCHAR(50) NULL DEFAULT NULL,
`amt` INT(11) NULL DEFAULT NULL,
`price` INT(11) NULL DEFAULT NULL
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;
Here I want to update amount and price in customer.
I am not able to update multiple columns, I can update single column using above syntax
Hi Manager,
I have 3+ years of experience working as a SQL and Maria SQL developer. I can help you with your task. Please reach me on chat window we can discuss on this. Thanks.
Regards,
Vinod
₹600 INR em 1 dia
5,0 (7 avaliações)
2,3
2,3
3 freelancers estão ofertando em média ₹817 INR for esse trabalho
Hi there,
I've reviewed your project description and glad to let you know that I can fix your Query and update multiple coloumn valus as per your instructions. I've 4+ years work experience in Website development so I can do it very well.
Please provide an opportunity to have a real-time conversation with you here. I can start your project immediately and look forward to working with you.
I BELIEVE "ON TIME IS A WONDERFUL THING"
With a Positive Hope!
Warm Regards,
Arvind Vashisat