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 |
|
rkl
Starting Member
3 Posts |
Posted - 2004-05-13 : 11:18:30
|
| HiI have a query like this:"SELECT P.id_member,M.namn FROM panel P,member M WHERE M.id=P.id_member"that returns:114 Robin Hood Born To Fun Fun Fun Fun Fun114 Robin Hood Donkeys in Me107 Roger Käll Spacecowboys for pleasure buy107 Roger Käll Amazing107 Roger Käll Spacecowboys for pleasure buy111 Don King Cream By Two111 Don King By the Bell111 Don King Born To Fun Fun Fun Fun Fun116 Lisa Morelius Amazing116 Lisa Morelius Spacecowboys for pleasure buy116 Lisa Morelius Cream By Twoand so on...The thing is i only want the first record for each id_member.How to do this ?Thanks !/RogerSweden |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
rkl
Starting Member
3 Posts |
Posted - 2004-05-13 : 12:20:40
|
| Yes, i will order but i didnt include that in this example, just wanted the way to get one record of each id_member. |
 |
|
|
rkl
Starting Member
3 Posts |
Posted - 2004-05-13 : 12:31:35
|
| Thanks to MS Access function FIRST i could do this in ONE Select-statment but it seems not possible in SQL Server. I guess i will have to retrive the id_member column first with a GROUP BY query and then make a querycall for each row returned. I will use this on a asp-webpage./Roger |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-05-13 : 13:12:15
|
| [code]SELECT P.id_member,MIN(M.namn) FROM panel P,member M WHERE M.id=P.id_memberGROUP BY P.id_member[/code]Brett8-) |
 |
|
|
|
|
|