skip to Main Content

Mysql multiple tables update – results inconsistent

UPDATE table1 alias1,table2 alias2 SET alias2.CURRENT_CD_BALANCE = alias2.CURRENT_CD_BALANCE - alias1.ORIGINAL_AMOUNT , alias1.COMMENT = concat('Sum of ',alias1.ORIGINAL_AMOUNT,' Cancelled') , alias1.BALANCE = 0, alias1.ORIGINAL_AMOUNT = 0, TRAN_TYPE = 'D' WHERE alias1.STORE_ID = alias2.STORE_ID AND alias1.ACCTNO = alias2.ACCTNO AND alias1.AR_TRANS_ID = value1; Query…

VIEW QUESTION

Many-to-Many MySQL Relationship

Good Morning, I'm after some help please :) I have a MySQL database with the following tables: incidents, users and incident_users. My incidents and users table are defined through a many-to-many relationship using the incident_users table. So, when a user…

VIEW QUESTION
Back To Top
Search