Click here to Skip to main content
15,880,725 members
Home / Discussions / Database
   

Database

 
GeneralRe: C# code Pin
RichardInToronto7-Dec-11 15:31
RichardInToronto7-Dec-11 15:31 
GeneralRe: C# code Pin
Mycroft Holmes7-Dec-11 15:55
professionalMycroft Holmes7-Dec-11 15:55 
Questiondatabase role permissions Pin
Danzy835-Dec-11 3:53
Danzy835-Dec-11 3:53 
AnswerRe: database role permissions Pin
R. Giskard Reventlov5-Dec-11 4:11
R. Giskard Reventlov5-Dec-11 4:11 
QuestionHow to import data from excel to sql server 2005 Pin
rahul honey4-Dec-11 23:47
rahul honey4-Dec-11 23:47 
AnswerRe: How to import data from excel to sql server 2005 Pin
PIEBALDconsult5-Dec-11 1:57
mvePIEBALDconsult5-Dec-11 1:57 
Questionhow to start business intelligence in sql server 2008 Pin
developerit4-Dec-11 20:03
developerit4-Dec-11 20:03 
Question.sql file Pin
palakash2-Dec-11 21:04
palakash2-Dec-11 21:04 
AnswerRe: .sql file Pin
R. Giskard Reventlov3-Dec-11 2:57
R. Giskard Reventlov3-Dec-11 2:57 
QuestionSql Server 2008R2 Developers version Pin
SQL Ed2-Dec-11 8:40
SQL Ed2-Dec-11 8:40 
AnswerRe: Sql Server 2008R2 Developers version Pin
Mycroft Holmes2-Dec-11 12:19
professionalMycroft Holmes2-Dec-11 12:19 
AnswerRe: Sql Server 2008R2 Developers version Pin
Wonde Tadesse2-Dec-11 16:46
professionalWonde Tadesse2-Dec-11 16:46 
QuestionSolved:Update Multiple Rows of one table on the base of multiple rows in another table Pin
Rupesh Kumar Swami2-Dec-11 0:26
Rupesh Kumar Swami2-Dec-11 0:26 
Hi All,
I want to update multiple columns of multiple rows of one table. Single/Multiple column update for single/Multiple row is quite easy but i want to update the rows of one table on the basis of rows of other table.
Here I demonstrate that what i want with single query

Table1 - History
Fields and Data

Date SId Country Price High Low ........
1 Dec 1 US 2 3 1 values...
1 Dec 2 US 3 4 2 values...
1 Dec 3 US 4 5 3 values...
1 Dec 4 US 5 6 4 values...
2 Dec 1 US 7 8 5 values...
2 Dec 2 US 8 9 6 values...
2 Dec 3 US 9 10 7 values...
2 Dec 4 US 10 11 8 values...


Table2 _ LatestPrice
Fields and Data

SId Country Price High Low ........
1 US 1 2 1 values...
2 US 1 2 1 values...
3 US 1 2 1 values...
4 US 1 2 1 values...


I want to update the LatestPrice table data on the base of field SID and Country from History table data.Here i pick the only highest date data from History table. Now i want to update data in LatestPrice table. so there are two approaches

One way is the pick one by one record from resultset and update the LatestPrice on the base of field SID and Country. so there are mulitple queries depends on the no. of records in resultset

Other way is write singe query in this way that they find automatically SId and Country and update the data.

So i was unable to write single query for update the Data.
Please suggest that how can i do this taks

any help will be appreciated
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


modified 3-Dec-11 6:52am.

AnswerRe: Update Multiple Rows of one table on the base of multiple rows in another table Pin
Varsha Ramnani2-Dec-11 0:44
professionalVarsha Ramnani2-Dec-11 0:44 
GeneralRe: Update Multiple Rows of one table on the base of multiple rows in another table Pin
Rupesh Kumar Swami2-Dec-11 2:51
Rupesh Kumar Swami2-Dec-11 2:51 
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 
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 

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.