Click here to Skip to main content
15,886,199 members
Home / Discussions / Database
   

Database

 
GeneralRe: Update Multiple Rows of one tableon the base of multiple rows in another table Pin
Varsha Ramnani2-Dec-11 4:20
professionalVarsha Ramnani2-Dec-11 4:20 
GeneralRe: Update Multiple Rows of one tableon the base of multiple rows in another table Pin
Rupesh Kumar Swami2-Dec-11 20:35
Rupesh Kumar Swami2-Dec-11 20:35 
GeneralRe: Update Multiple Rows of one tableon the base of multiple rows in another table Pin
Varsha Ramnani2-Dec-11 23:34
professionalVarsha Ramnani2-Dec-11 23:34 
GeneralRe: Update Multiple Rows of one tableon the base of multiple rows in another table Pin
Rupesh Kumar Swami3-Dec-11 0:52
Rupesh Kumar Swami3-Dec-11 0:52 
GeneralRe: Update Multiple Rows of one table on the base of multiple rows in another table Pin
Eddy Vluggen3-Dec-11 4:26
professionalEddy Vluggen3-Dec-11 4:26 
GeneralRe: Update Multiple Rows of one table on the base of multiple rows in another table Pin
Varsha Ramnani4-Dec-11 17:15
professionalVarsha Ramnani4-Dec-11 17:15 
AnswerRe: Update Multiple Rows of one table on the base of multiple rows in another table Pin
Jörgen Andersson2-Dec-11 3:59
professionalJörgen Andersson2-Dec-11 3:59 
GeneralRe: Update Multiple Rows of one table on the base of multiple rows in another table Pin
Rupesh Kumar Swami2-Dec-11 20:42
Rupesh Kumar Swami2-Dec-11 20:42 
HI Jorgen
thanks a lot for you suggestion.

View option is not applicable for my requirement. since I need to update the data in table.

Also i tried the Merge option as you suggested but with a little modification and it is the original query

MERGE INTO issdetails_new lp USING ( SELECT Max( MktCloseDate ) , secid,country, PriceDate,<br />
OPEN , High, Low, Close, Ask, Last, Bid, BidSize, AskSize, TradedVolume, MktCloseDate, Volflag, TradedValue, TotalTrades,<br />
COMMENT , LocalCode<br />
FROM hist_prices<br />
GROUP BY secid, PriceDate,<br />
OPEN , High, Low, Close, Ask, Last, Bid, BidSize, AskSize, TradedVolume, MktCloseDate, Volflag, TradedValue, TotalTrades,<br />
COMMENT , LocalCode ) AS h ON (lp.Secid = h.Secid and lp.country=h.country)<br />
WHEN MATCHED<br />
THEN UPDATE SET lp.PriceDate = h.PriceDate,<br />
lp.open = h.open,<br />
lp.Low = h.Low,<br />
lp.high = h.high,<br />
lp.close = h.close,<br />
lp.ask = h.ask,<br />
lp.last = h.last,<br />
lp.bid = h.bid,<br />
lp.bidsize = h.bidsize,<br />
lp.asksize = h.asksize,<br />
lp.TradedVolume = h.TradedVolume,<br />
lp.MktCloseDate = h.MktCloseDate,<br />
lp.Volflag = h.Volflag,<br />
lp.TradedValue = h.TradedValue,<br />
lp.TotalTrades = h.TotalTrades,<br />
lp.Comment = h.Comment,<br />
lp.LocalCode = h.LocalCode


but it gives me following error

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MERGE INTO issdetails_new lp USING ( SELECT Max(MktCloseDate),secid,Pric' at line 1

Please suggest where i am doing wrong.
rup28aug@yahoo.co.in
Rupesh Kumar Swami
Software Developer,
Integrated Solution,
Bikaner (India)

Company - ISOL, India


Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

GeneralRe: Update Multiple Rows of one table on the base of multiple rows in another table Pin
Jörgen Andersson2-Dec-11 22:45
professionalJörgen Andersson2-Dec-11 22:45 
GeneralRe: Update Multiple Rows of one table on the base of multiple rows in another table Pin
Rupesh Kumar Swami2-Dec-11 23:32
Rupesh Kumar Swami2-Dec-11 23:32 
GeneralRe: Update Multiple Rows of one table on the base of multiple rows in another table Pin
Jörgen Andersson3-Dec-11 3:32
professionalJörgen Andersson3-Dec-11 3:32 
GeneralRe: Update Multiple Rows of one table on the base of multiple rows in another table Pin
Rupesh Kumar Swami3-Dec-11 1:18
Rupesh Kumar Swami3-Dec-11 1:18 
QuestionSqlserver Pin
infobeena1-Dec-11 22:28
infobeena1-Dec-11 22:28 
AnswerRe: Sqlserver Pin
infobeena1-Dec-11 22:33
infobeena1-Dec-11 22:33 
GeneralRe: Sqlserver Pin
jschell2-Dec-11 8:49
jschell2-Dec-11 8:49 
AnswerRe: Sqlserver Pin
thatraja1-Dec-11 22:41
professionalthatraja1-Dec-11 22:41 
JokeRe: Sqlserver Pin
Eddy Vluggen2-Dec-11 7:31
professionalEddy Vluggen2-Dec-11 7:31 
JokeRe: Sqlserver Pin
SilimSayo14-Dec-11 3:25
SilimSayo14-Dec-11 3:25 
JokeRe: Sqlserver Pin
SilimSayo2-Dec-11 9:37
SilimSayo2-Dec-11 9:37 
QuestionSQLite's FAIL ALGORITHM IN ONCONFLICT CLAUSE Pin
Member 83043881-Dec-11 20:16
Member 83043881-Dec-11 20:16 
QuestionDTC crashing SQL server on an update? Pin
devvvy1-Dec-11 18:43
devvvy1-Dec-11 18:43 
QuestionDatabase unable to return data to all clients for 10 clients or more making same call at same time. Pin
Steve Holdorf1-Dec-11 3:22
Steve Holdorf1-Dec-11 3:22 
AnswerRe: Database unable to return data to all clients for 10 clients or more making same call at same time. Pin
Shameel1-Dec-11 3:56
professionalShameel1-Dec-11 3:56 
GeneralRe: Database unable to return data to all clients for 10 clients or more making same call at same time. Pin
Steve Holdorf1-Dec-11 4:05
Steve Holdorf1-Dec-11 4:05 
AnswerRe: Database unable to return data to all clients for 10 clients or more making same call at same time. Pin
Steve Holdorf1-Dec-11 7:22
Steve Holdorf1-Dec-11 7:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.