Click here to Skip to main content
15,908,013 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to filter duplicate data about technical support and compute rank Pin
TenmanS1417-Apr-12 11:00
TenmanS1417-Apr-12 11:00 
GeneralRe: How to filter duplicate data about technical support and compute rank Pin
bbaaking17-Apr-12 16:41
bbaaking17-Apr-12 16:41 
GeneralRe: How to filter duplicate data about technical support and compute rank Pin
TenmanS1417-Apr-12 21:59
TenmanS1417-Apr-12 21:59 
GeneralRe: How to filter duplicate data about technical support and compute rank Pin
bbaaking17-Apr-12 22:20
bbaaking17-Apr-12 22:20 
AnswerRe: How to filter duplicate data about technical support and compute rank Pin
Jörgen Andersson17-Apr-12 22:37
professionalJörgen Andersson17-Apr-12 22:37 
GeneralRe: How to filter duplicate data about technical support and compute rank Pin
bbaaking17-Apr-12 22:54
bbaaking17-Apr-12 22:54 
AnswerRe: complicated SQL: How to filter duplicate data about technical support and compute rank Pin
TenmanS1418-Apr-12 11:40
TenmanS1418-Apr-12 11:40 
GeneralRe: complicated SQL: How to filter duplicate data about technical support and compute rank Pin
bbaaking18-Apr-12 21:56
bbaaking18-Apr-12 21:56 
Thanks a lot!
I add filter statement( aim 1, without it the result will not be correct),like:
SQL
SELECT * FROM (SELECT COUNT(TCID) as count, TCID, Month FROM (
    SELECT month(endtime) as Month, tcid, serviceid 
	FROM (SELECT MIN(Qos) qos, serviceid, id, TCID, EndTime from service
		GROUP BY serviceid
    	)T1
	WHERE qos = 1
	group by month(endTime),tcid, serviceid
    )As T
GROUP BY month, tcid) AS S
order by month, count DESC

and It got correct data:
SQL
count	TCID	Month
4	Andrew	1
3	Jacob	1
2	Tyler	1
2	Dylan	1
1	Daniel	1
4	Dylan	2
4	Jacob	2
4	Andrew	2
2	Tyler	2
1	Daniel	2

I think It is half of aim 2, thank you. please go on ,I think Top-2-in-January(rank) is Andrew/Jacob, Top-2-in-February(rank) is Andrew/Dylan/Jacob . So the result of aim2 should be 2 reocrders: Andrew/Jacob

modified 19-Apr-12 4:11am.

AnswerI have solved it by myself Pin
bbaaking22-Apr-12 20:22
bbaaking22-Apr-12 20:22 
SuggestionSync data Bi-Directional Automatically- Sql Server 2008 Pin
dsrao16-Apr-12 11:49
dsrao16-Apr-12 11:49 
GeneralRe: Sync data Bi-Directional Automatically- Sql Server 2008 Pin
kalaisw17-Apr-12 2:06
kalaisw17-Apr-12 2:06 
GeneralRe: Sync data Bi-Directional Automatically- Sql Server 2008 Pin
dsrao17-Apr-12 6:48
dsrao17-Apr-12 6:48 
GeneralRe: Sync data Bi-Directional Automatically- Sql Server 2008 Pin
TenmanS1419-Apr-12 4:44
TenmanS1419-Apr-12 4:44 
GeneralRe: Sync data Bi-Directional Automatically- Sql Server 2008 Pin
JosephvObrien19-Apr-12 22:14
JosephvObrien19-Apr-12 22:14 
QuestionT-SQL Developer needed for hire. Pin
SQL Ed15-Apr-12 5:13
SQL Ed15-Apr-12 5:13 
AnswerRe: T-SQL Developer needed for hire. Pin
Mycroft Holmes15-Apr-12 13:54
professionalMycroft Holmes15-Apr-12 13:54 
GeneralRe: T-SQL Developer needed for hire. Pin
SQL Ed16-Apr-12 0:32
SQL Ed16-Apr-12 0:32 
GeneralRe: T-SQL Developer needed for hire. Pin
SQL Ed16-Apr-12 0:32
SQL Ed16-Apr-12 0:32 
GeneralRe: T-SQL Developer needed for hire. Pin
Mycroft Holmes16-Apr-12 3:15
professionalMycroft Holmes16-Apr-12 3:15 
AnswerRe: T-SQL Developer needed for hire. Pin
PIEBALDconsult15-Apr-12 18:47
mvePIEBALDconsult15-Apr-12 18:47 
Questionselect in star schema Pin
mrx10014-Apr-12 22:34
mrx10014-Apr-12 22:34 
AnswerRe: select in star schema Pin
phil.o14-Apr-12 22:46
professionalphil.o14-Apr-12 22:46 
GeneralRe: select in star schema Pin
mrx10014-Apr-12 23:04
mrx10014-Apr-12 23:04 
QuestionRe: select in star schema Pin
Eddy Vluggen15-Apr-12 0:45
professionalEddy Vluggen15-Apr-12 0:45 
AnswerRe: select in star schema Pin
Luc Pattyn15-Apr-12 3:29
sitebuilderLuc Pattyn15-Apr-12 3:29 

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.