Concluído

Need small help in mariadb multi column update -- 2

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

Habilidades: PHP, JavaScript, Arquitetura de software, MySQL, MariaDB

Sobre o Cliente:
( 24 comentários ) Pune, India

ID do Projeto: #27048549

Concedido a:

vinodkumar7594

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
(7 Comentários)
2.3

3 freelancers estão ofertando em média ₹817 nesse trabalho

arvindvashi

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 Mais

₹1250 INR em 1 dia
(29 Comentários)
4.5
neefsmichiel

I'll just hand over the solution to you, if you are happy with it, you pay. If you're not, you don't pay. Sounds like a deal?

₹600 INR em 1 dia
(0 Comentários)
0.0