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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL pronlem same reslults

Author  Topic 

papier14
Starting Member

3 Posts

Posted - 2012-01-11 : 12:46:53
Hi,

I got a problem:
I want to have all the results of this query, only its gives a problem: All the results have the same team... I want that every result has is own team.

How it looks now:
http://www.uploadplaatjes.nl/plaatje.php?id=331593

I want the Tablerow Teamnaam is the same as 1. So 1 = vlijtig liesje 2 = joopje. The table naam with the numbers is called TSK.TSKiD, How do i manage those 2 in the right thing??

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-11 : 12:53:06
No idea unless we see how data is present in your tables and how they're related. Post some sample data from your tables which are used for getting above result so that somebody can help

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

papier14
Starting Member

3 Posts

Posted - 2012-01-11 : 13:09:20
My database: http://www.uploadplaatjes.nl/plaatje.php?id=331624


The query : SELECT SETid, WEDSTRIJDid, Score_TeamA, Score_TeamB, Punten_TeamA, Punten_TeamB, datum, tijd, veld
FROM SET_UITSLAG, WEDSTRIJD, TSK_HAS_WEDSTRIJD, TSK, TEAM

WHERE SET_UITSLAG.WEDSTRIJD_WEDSTRIJDid = WEDSTRIJD.WEDSTRIJDid = TSK_HAS_WEDSTRIJD.WEDSTRIJD_WEDSTRIJDid

AND
TEAM.TEAMid = TSK.TSKid = TSK.TEAM_TEAMid

AND
TSK_HAS_WEDSTRIJD.TSK_TSKid = TSK.TSKid

AND
datum = '2009-10-06'

The result: http://www.uploadplaatjes.nl/plaatje.php?id=331593

But i want : http://www.uploadplaatjes.nl/plaatje.php?id=331623

U see? In the table TEAM there is TeamiD and TeamNaam. TeamiD 1 = teamNaam klaviervier TeamID 2 = teamNaam konjo etcetra.
Now TeamID = TSKid
and TSKid = TSK_TSKid
so now i want to get TSK_TSKid 1 and then i want klaviervier as name, how do i manage that?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-11 : 13:13:48
hmm...where's sample data from tables as requested?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

papier14
Starting Member

3 Posts

Posted - 2012-01-11 : 13:22:50
Oke
Here the table TSK:
http://www.uploadplaatjes.nl/plaatje.php?id=331650
Here the table TSK_has_TEAM:
http://www.uploadplaatjes.nl/plaatje.php?id=331651
Here the table WEDSTRIJD:
http://www.uploadplaatjes.nl/plaatje.php?id=331653
Here the table SET_UITSLAG:
http://www.uploadplaatjes.nl/plaatje.php?id=331662
Here the table TEAM:
http://www.uploadplaatjes.nl/plaatje.php?id=331663

Those data u need;)
Go to Top of Page
   

- Advertisement -