Click here to Skip to main content
15,848,349 members
Home / Discussions / Database
   

Database

 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
ToddHileHoffer12-Aug-05 7:36
ToddHileHoffer12-Aug-05 7:36 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Marc Clifton12-Aug-05 7:45
mvaMarc Clifton12-Aug-05 7:45 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
ToddHileHoffer12-Aug-05 8:04
ToddHileHoffer12-Aug-05 8:04 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Marc Clifton13-Aug-05 13:30
mvaMarc Clifton13-Aug-05 13:30 
GeneralCorrelated Subquery Problem Pin
mjackson1111-Aug-05 10:52
mjackson1111-Aug-05 10:52 
GeneralRe: Correlated Subquery Problem Pin
ToddHileHoffer12-Aug-05 8:09
ToddHileHoffer12-Aug-05 8:09 
GeneralAt attempt 341: "Object not set to an instance of an object" Pin
alexvw11-Aug-05 6:10
alexvw11-Aug-05 6:10 
GeneralT-SQL Question Pin
WDI11-Aug-05 2:43
WDI11-Aug-05 2:43 
Hi
Suppose we have table T as :

ID | Rank
________|________

3 2
3 1
6 7
8 3
6 9
12 8
3 9
3 1


ID is the Id of an article. Each user that see the Article can give it a rank ; (1 =< rank <= 9)

For a given ID , I want all the ranks of it as a ordered table. For example :
For ID = 3 I want to have

Rank | Count
______|_________

1 2
2 1
3 0
4 0
5 0
6 0
7 0
8 0
9 1

I have wrote a stored procedure as:

SP_GetRank<br />
<br />
@ID int<br />
.<br />
.<br />
.<br />
<br />
select ID , Rank into #temp1 from T where ID = @ID<br />
select  Rank , count(Rank) as [count] from #temp1 group by rank<br />
<br />
.<br />
.<br />
.

This procedure works peoperly when for each ID , each number of 1 to 9 at least one time presents in table T.
How i change my sp?
Thanks a lot!
GeneralRe: T-SQL Question Pin
Colin Angus Mackay11-Aug-05 3:23
Colin Angus Mackay11-Aug-05 3:23 
GeneralRe: T-SQL Question Pin
Michael Potter11-Aug-05 5:02
Michael Potter11-Aug-05 5:02 
GeneralRe: T-SQL Question Pin
Colin Angus Mackay11-Aug-05 5:06
Colin Angus Mackay11-Aug-05 5:06 
GeneralMultiuser Pin
peepys10-Aug-05 19:06
peepys10-Aug-05 19:06 
GeneralRe: Multiuser Pin
Christian Graus10-Aug-05 19:48
protectorChristian Graus10-Aug-05 19:48 
QuestionHow to Update a row in Datagrid Pin
dwark10610-Aug-05 15:49
dwark10610-Aug-05 15:49 
Generalrestore database command Pin
Anonymous10-Aug-05 11:42
Anonymous10-Aug-05 11:42 
GeneralNew Trigger at run-time Pin
RoyRose7810-Aug-05 10:16
RoyRose7810-Aug-05 10:16 
GeneralServer Crash!!!! Pin
Anonymous10-Aug-05 6:56
Anonymous10-Aug-05 6:56 
GeneralError in updating foxpro table.. :-( Pin
Member 185596310-Aug-05 6:08
Member 185596310-Aug-05 6:08 
GeneralRe: Error in updating foxpro table.. :-( Pin
Rob Graham10-Aug-05 6:13
Rob Graham10-Aug-05 6:13 
GeneralRe: Error in updating foxpro table.. :-( Pin
Member 185596310-Aug-05 7:33
Member 185596310-Aug-05 7:33 
Generalstatus design question Pin
deepakt110-Aug-05 3:24
deepakt110-Aug-05 3:24 
GeneralRe: status design question Pin
Colin Angus Mackay10-Aug-05 7:16
Colin Angus Mackay10-Aug-05 7:16 
GeneralRe: status design question Pin
deepakt110-Aug-05 20:21
deepakt110-Aug-05 20:21 
GeneralRe: status design question Pin
Colin Angus Mackay10-Aug-05 23:05
Colin Angus Mackay10-Aug-05 23:05 
Generalthreading issue Pin
Laffis10-Aug-05 0:01
Laffis10-Aug-05 0:01 

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.