Terminé

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

Compétences : PHP, JavaScript, Architecture Logicielle, MySQL, MariaDB

en voir plus : mariadb add column, mariadb update from select, mariadb update join, mariadb update multiple columns, mariadb update column, mariadb update multiple rows, mariadb select for update example, mariadb update query with join, phpbb3 multi column, help need marketing help, multi column posts wordpress, multi column wordpess, need someone help create logo, designed website need end help, companies need translating help, multi column richtextbox, flash multi column scrollpane, need someone help css, wordpress multi column post, multi column wordpress

Concernant l'employeur :
( 24 commentaires ) Pune, India

Nº du projet : #27048549

Décerné à:

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

%selectedBids___i_sum_sub_4% %project_currencyDetails_sign_sub_5% INR en 1 jour
(7 Commentaires)
2.3

3 freelances font une offre moyenne de 817 ₹ pour ce travail

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 Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(29 Commentaires)
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?

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
0.0