Click here to Skip to main content
15,897,891 members
Home / Discussions / Database
   

Database

 
QuestionCTE Query taking too long Pin
Richard.Berry10027-Oct-13 8:03
Richard.Berry10027-Oct-13 8:03 
AnswerRe: CTE Query taking too long Pin
Mycroft Holmes27-Oct-13 13:06
professionalMycroft Holmes27-Oct-13 13:06 
GeneralRe: CTE Query taking too long Pin
Richard.Berry10027-Oct-13 18:54
Richard.Berry10027-Oct-13 18:54 
GeneralRe: CTE Query taking too long Pin
Mycroft Holmes27-Oct-13 19:18
professionalMycroft Holmes27-Oct-13 19:18 
GeneralRe: CTE Query taking too long Pin
Richard.Berry10028-Oct-13 8:26
Richard.Berry10028-Oct-13 8:26 
GeneralRe: CTE Query taking too long Pin
Jörgen Andersson28-Oct-13 10:35
professionalJörgen Andersson28-Oct-13 10:35 
GeneralRe: CTE Query taking too long Pin
Richard.Berry10028-Oct-13 18:39
Richard.Berry10028-Oct-13 18:39 
QuestionCount related Pin
Corporal Agarn25-Oct-13 5:37
professionalCorporal Agarn25-Oct-13 5:37 
In SQL Server 2008R2, I two tables:
T1.V1
1
2
3

T2.V1 T1.V2
1 A
2 B
3 A

I tried:

SQL
SELECT T1.V1, COUNT(T2.V2) OVER(PARTITION T2.V2) AS MyCount 
FROM T1 
INNER JOIN T2 ON T1.V1 = T2.V1

and got what asked for not what I wanted.

What I want is the number of V2's in T2.

Output was:
V1 MyCount
1 1
2 1
3 1

Wanted
V1 MyCount
1 2
2 1
3 2

I hope my simplification of the problem gives enough information.

Thanks
AnswerRe: Count related Pin
Richard Deeming25-Oct-13 7:47
mveRichard Deeming25-Oct-13 7:47 
GeneralRe: Count related Pin
Corporal Agarn25-Oct-13 8:13
professionalCorporal Agarn25-Oct-13 8:13 
QuestionWhat is the format of the connection string used for mysql database access? Pin
Gbenbam24-Oct-13 15:59
Gbenbam24-Oct-13 15:59 
AnswerRe: What is the format of the connection string used for mysql database access? Pin
PIEBALDconsult24-Oct-13 17:33
mvePIEBALDconsult24-Oct-13 17:33 
AnswerRe: What is the format of the connection string used for mysql database access? Pin
coded00725-Oct-13 3:17
professionalcoded00725-Oct-13 3:17 
QuestionLINQ syntax Pin
vkEE24-Oct-13 3:24
vkEE24-Oct-13 3:24 
QuestionRe: LINQ syntax Pin
thatraja24-Oct-13 3:37
professionalthatraja24-Oct-13 3:37 
AnswerRe: LINQ syntax Pin
vkEE24-Oct-13 3:58
vkEE24-Oct-13 3:58 
GeneralRe: LINQ syntax Pin
Bernhard Hiller24-Oct-13 21:28
Bernhard Hiller24-Oct-13 21:28 
AnswerRe: LINQ syntax Pin
Richard Deeming24-Oct-13 4:25
mveRichard Deeming24-Oct-13 4:25 
NewsProblem Connecting To SQL from SOME Machines Pin
Kevin Marois22-Oct-13 9:29
professionalKevin Marois22-Oct-13 9:29 
AnswerRe: Problem Connecting To SQL from SOME Machines Pin
thatraja22-Oct-13 22:36
professionalthatraja22-Oct-13 22:36 
GeneralRe: Problem Connecting To SQL from SOME Machines Pin
jschell23-Oct-13 9:48
jschell23-Oct-13 9:48 
GeneralRe: Problem Connecting To SQL from SOME Machines Pin
Bernhard Hiller23-Oct-13 20:43
Bernhard Hiller23-Oct-13 20:43 
GeneralRe: Problem Connecting To SQL from SOME Machines Pin
jschell24-Oct-13 7:47
jschell24-Oct-13 7:47 
QuestionHow to insert data in the tables Pin
lichengjuan-421-Oct-13 18:39
lichengjuan-421-Oct-13 18:39 
AnswerRe: How to insert data in the tables PinPopular
Mycroft Holmes21-Oct-13 18:44
professionalMycroft Holmes21-Oct-13 18:44 

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.