Click here to Skip to main content
15,916,835 members
Home / Discussions / Database
   

Database

 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
ToddHileHoffer12-Aug-05 6:36
ToddHileHoffer12-Aug-05 6:36 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Marc Clifton12-Aug-05 6:45
mvaMarc Clifton12-Aug-05 6:45 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
ToddHileHoffer12-Aug-05 7:04
ToddHileHoffer12-Aug-05 7:04 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Marc Clifton13-Aug-05 12:30
mvaMarc Clifton13-Aug-05 12:30 
GeneralCorrelated Subquery Problem Pin
mjackson1111-Aug-05 9:52
mjackson1111-Aug-05 9:52 
GeneralRe: Correlated Subquery Problem Pin
ToddHileHoffer12-Aug-05 7:09
ToddHileHoffer12-Aug-05 7:09 
GeneralAt attempt 341: "Object not set to an instance of an object" Pin
alexvw11-Aug-05 5:10
alexvw11-Aug-05 5:10 
GeneralT-SQL Question Pin
WDI11-Aug-05 1:43
WDI11-Aug-05 1: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 2:23
Colin Angus Mackay11-Aug-05 2:23 
GeneralRe: T-SQL Question Pin
Michael Potter11-Aug-05 4:02
Michael Potter11-Aug-05 4:02 
GeneralRe: T-SQL Question Pin
Colin Angus Mackay11-Aug-05 4:06
Colin Angus Mackay11-Aug-05 4:06 
GeneralMultiuser Pin
peepys10-Aug-05 18:06
peepys10-Aug-05 18:06 
GeneralRe: Multiuser Pin
Christian Graus10-Aug-05 18:48
protectorChristian Graus10-Aug-05 18:48 
QuestionHow to Update a row in Datagrid Pin
dwark10610-Aug-05 14:49
dwark10610-Aug-05 14:49 
Generalrestore database command Pin
Anonymous10-Aug-05 10:42
Anonymous10-Aug-05 10:42 
GeneralNew Trigger at run-time Pin
RoyRose7810-Aug-05 9:16
RoyRose7810-Aug-05 9:16 
GeneralServer Crash!!!! Pin
Anonymous10-Aug-05 5:56
Anonymous10-Aug-05 5:56 
GeneralError in updating foxpro table.. :-( Pin
Member 185596310-Aug-05 5:08
Member 185596310-Aug-05 5:08 
GeneralRe: Error in updating foxpro table.. :-( Pin
Rob Graham10-Aug-05 5:13
Rob Graham10-Aug-05 5:13 
GeneralRe: Error in updating foxpro table.. :-( Pin
Member 185596310-Aug-05 6:33
Member 185596310-Aug-05 6:33 
Generalstatus design question Pin
deepakt110-Aug-05 2:24
deepakt110-Aug-05 2:24 
GeneralRe: status design question Pin
Colin Angus Mackay10-Aug-05 6:16
Colin Angus Mackay10-Aug-05 6:16 
GeneralRe: status design question Pin
deepakt110-Aug-05 19:21
deepakt110-Aug-05 19:21 
GeneralRe: status design question Pin
Colin Angus Mackay10-Aug-05 22:05
Colin Angus Mackay10-Aug-05 22:05 
Generalthreading issue Pin
Laffis9-Aug-05 23:01
Laffis9-Aug-05 23: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.