| Bug #63046 | update in mysql - please help | ||
|---|---|---|---|
| Submitted: | 31 Oct 2011 20:12 | Modified: | 31 Oct 2011 20:27 |
| Reporter: | Ankush Agrawal | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: DML | Severity: | S2 (Serious) |
| Version: | MS sql server 9.00 | OS: | Windows |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | MySQL, two table update, UPDATE | ||
[31 Oct 2011 20:27]
MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug. Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/ Thank you for your interest in MySQL.

Description: hi - I am trying to do update in table using one value in expression from another table - update [dbo].[STG_DCM_OUT_1] set (start_date, end_date) = ( select a.item_nbr, a.store_nbr, a.pres_min, dateadd (week, -b.lead , start_date) as start_date, dateadd (week, -b.lead , end_date) as end_date from [dbo].[STG_DCM_OUT_1] a, [dbo].[STG_STORE_LEAD] b where a.store_nbr=b.store_no )d where item_nbr= d.item_nbr and store_nbr = d.store_nbr i am getting this error - not sure where i am wrong. 102: Incorrect syntax near '('. 102: Incorrect syntax near 'd'. Thanks How to repeat: table [STG_DCM_OUT_1] Create Table dbo.STG_DCM_OUT_1( ITEM_NBR varchar(16) Not Null, STORE_NBR int Not Null, PRES_MIN int, START_DATE datetime, END_DATE datetime ) table [dbo].[STG_STORE_LEAD] Create Table IKB_STG.STG_STORE_LEAD ( STORE_NO int, LEAD int)