Click here to Skip to main content
15,901,284 members
Home / Discussions / Database
   

Database

 
AnswerRe: How SQL command queury the first character of a Name column from a MS Access database? Pin
Luc Pattyn9-Mar-10 5:45
sitebuilderLuc Pattyn9-Mar-10 5:45 
GeneralRe: How SQL command queury the first character of a Name column from a MS Access database? Pin
Curious 20099-Mar-10 6:40
Curious 20099-Mar-10 6:40 
GeneralRe: How SQL command queury the first character of a Name column from a MS Access database? Pin
Luc Pattyn9-Mar-10 7:01
sitebuilderLuc Pattyn9-Mar-10 7:01 
GeneralRe: How SQL command queury the first character of a Name column from a MS Access database? Pin
Roger Wright9-Mar-10 18:38
professionalRoger Wright9-Mar-10 18:38 
GeneralRe: How SQL command queury the first character of a Name column from a MS Access database? Pin
Luc Pattyn10-Mar-10 2:36
sitebuilderLuc Pattyn10-Mar-10 2:36 
AnswerRe: How SQL command queury the first character of a Name column from a MS Access database? Pin
David Mujica9-Mar-10 5:47
David Mujica9-Mar-10 5:47 
GeneralRe: How SQL command queury the first character of a Name column from a MS Access database? Pin
Curious 20099-Mar-10 6:38
Curious 20099-Mar-10 6:38 
Questionsql select/grouping question Pin
djhankypark9-Mar-10 1:04
djhankypark9-Mar-10 1:04 
Hello there

I have a table which contains the following fields...

artist
title
count_played
date_title_played

I am trying to figure out how to present a top ten most played, but I can't seem to get my head around how to stop it showing duplicate count_played. At the moment I have used the following Select...

SELECT top 10 artist, title, count_played, date_title_played
FROM dbo.songlist
WHERE count_played >0
ORDER BY count_played DESC, date_title_played DESC


However this is what shows...

Artist             Title                        Count  Last Played 
Wanted By The FBI  Until the End of the World   22     09/03/2010 11:22:16 
Koko Conley        Keep Your Head Up            22     09/03/2010 10:35:07 
Red Sun            Compromise                   21     09/03/2010 11:08:57 
Cara               Friend of Mine               21     09/03/2010 11:01:09 
Preet              Whos going to love you live  20     09/03/2010 10:51:22 
The Ambersons      Oh, my Isabelle              19     09/03/2010 10:51:22 
Patchwork Grace    Boozawaffle                  19     09/03/2010 10:49:01 
VK Lynne           Find Me                      18     09/03/2010 10:45:33 
Clara Barker       Wishing                      17     09/03/2010 10:43:45 
Red Sun            Just To Hold You             17     09/03/2010 10:11:00


What I actually want is...

Artist             Title                        Count  Last Played 
Wanted By The FBI  Until the End of the World   22     09/03/2010 11:22:16 
Red Sun            Compromise                   21     09/03/2010 11:08:57 
Preet              Whos going to love you live  20     09/03/2010 10:51:22 
The Ambersons      Oh, my Isabelle              19     09/03/2010 10:51:22 
VK Lynne           Find Me                      18     09/03/2010 10:45:33 
Clara Barker       Wishing                      17     09/03/2010 10:43:45


and so on.

I am not that experienced with sql queries but if someone could point me in the right direction on this it would be very much appreciated. Is it some sort of grouping that i need to use?

Regards

Ray
AnswerRe: sql select/grouping question [modified] Pin
Wayne Gaylard9-Mar-10 1:42
professionalWayne Gaylard9-Mar-10 1:42 
GeneralRe: sql select/grouping question Pin
djhankypark9-Mar-10 7:32
djhankypark9-Mar-10 7:32 
AnswerRe: sql select/grouping question Pin
Corporal Agarn9-Mar-10 6:07
professionalCorporal Agarn9-Mar-10 6:07 
GeneralRe: sql select/grouping question Pin
Corporal Agarn9-Mar-10 8:05
professionalCorporal Agarn9-Mar-10 8:05 
GeneralRe: sql select/grouping question Pin
djhankypark26-Mar-10 23:50
djhankypark26-Mar-10 23:50 
GeneralRe: sql select/grouping question Pin
Corporal Agarn29-Mar-10 0:43
professionalCorporal Agarn29-Mar-10 0:43 
QuestionUpdate a date/time field through VB. net Pin
Johnkokk8-Mar-10 23:57
Johnkokk8-Mar-10 23:57 
AnswerRe: Update a date/time field through VB. net Pin
Johnkokk9-Mar-10 0:11
Johnkokk9-Mar-10 0:11 
QuestionHelp with access query Pin
sarang_k8-Mar-10 18:18
sarang_k8-Mar-10 18:18 
AnswerRe: Help with access query Pin
Mycroft Holmes8-Mar-10 18:53
professionalMycroft Holmes8-Mar-10 18:53 
GeneralRe: Help with access query Pin
_Damian S_8-Mar-10 18:55
professional_Damian S_8-Mar-10 18:55 
AnswerRe: Help with access query Pin
_Damian S_8-Mar-10 18:54
professional_Damian S_8-Mar-10 18:54 
AnswerRe: Help with access query Pin
riced8-Mar-10 22:43
riced8-Mar-10 22:43 
QuestionCreating multiple sql stored procedures from vb .net Pin
iramirezp8-Mar-10 5:54
iramirezp8-Mar-10 5:54 
AnswerRe: Creating multiple sql stored procedures from vb .net Pin
Not Active8-Mar-10 6:19
mentorNot Active8-Mar-10 6:19 
GeneralRe: Creating multiple sql stored procedures from vb .net Pin
iramirezp8-Mar-10 6:50
iramirezp8-Mar-10 6:50 
AnswerRe: Creating multiple sql stored procedures from vb .net Pin
RCoate8-Mar-10 13:28
RCoate8-Mar-10 13:28 

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.