Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ganeshkumar08
Posting Yak Master
187 Posts |
Posted - 2008-07-24 : 09:19:58
|
| I have Two TableTable1(MatchID,MatchName,QCName)Table2(MatchID,PlayerName,StartTime,EndTime)From the above two table My Result Table Must have----------------------------------------MatchName | QCNameMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchName | QCNameMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimecan i result as aboveThanksGaneshSolutions are easy. Understanding the problem, now, that's the hard part |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-07-24 : 09:33:41
|
| i'm gonna assume you player name in the group is actually qcname?select MatchName,QCName,t2.MatchID,PlayerName,StartTime,EndTimefrom table1 t1 join table2 t2on t1.MatchID = t2.MatchIDhow you then 'group them' as described in your post is for your presentation layer to worry aboutEm |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-24 : 09:41:55
|
quote: Originally posted by ganeshkumar08 I have Two TableTable1(MatchID,MatchName,QCName)Table2(MatchID,PlayerName,StartTime,EndTime)From the above two table My Result Table Must have----------------------------------------MatchName | PlayerNameMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchName | PlayerNameMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimeMatchID|PlayerName|StartTime|EndTimecan i result as aboveThanksGaneshSolutions are easy. Understanding the problem, now, that's the hard part
The format is something that you need to do at your front end. you just need to retrive the records as a complete set and then do formatting from it. Whats the front end you're using? |
 |
|
|
ganeshkumar08
Posting Yak Master
187 Posts |
Posted - 2008-07-24 : 09:43:13
|
| No Need grouping here, Directly we need to match the MatchID column from both tables and have to format the Results as above specifiedSolutions are easy. Understanding the problem, now, that's the hard part |
 |
|
|
ganeshkumar08
Posting Yak Master
187 Posts |
Posted - 2008-07-24 : 09:43:49
|
| i am using C#Solutions are easy. Understanding the problem, now, that's the hard partAnd small modification, Instead of QC name i gave there Playername.My result should be like this.MatchName | QC NameMatchName PlayerName StartTime EndTime |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-07-24 : 10:28:28
|
| Where are you outputting the data? Using C# doesn't tell us how you eventually are creating the output. That is where you do your grouping.- Jeffhttp://weblogs.sqlteam.com/JeffS |
 |
|
|
MakeYourDaddyProud
184 Posts |
Posted - 2008-07-24 : 11:37:00
|
| It is never the responsibility to mangle data on the presentation layer.Your SQL has to appear in a Stored Procedure as two SQLscreate procedure matchresult...SELECT MatchName, 1 QCName...SELECT MatchName, 2, PlayerName StartTime EndTimeRETURNYou will then need to implement Sorting in your C# disconnected ADO.Net DataSet object (do not use a DataAdapter Cursor). Look for a Sort() method using COLUMN 1 and 2. This will give you Match header and player detail pairs which can then be presented to the Presentation Layer in one dataset to your presentation layer via Binded Server controls.I wont go into much more detail than that becuase this is really an SQL forum.Are you good enough? Skillprover.com |
 |
|
|
|
|
|
|
|