Click here to Skip to main content
15,902,939 members
Home / Discussions / Database
   

Database

 
GeneralRe: Warning: Null value is eliminated by an aggregate or other SET operation Pin
Ashfield17-Apr-08 19:53
Ashfield17-Apr-08 19:53 
GeneralToo many results Pin
John R. Shaw17-Apr-08 15:22
John R. Shaw17-Apr-08 15:22 
GeneralRe: Too many results Pin
Blue_Boy17-Apr-08 15:51
Blue_Boy17-Apr-08 15:51 
General[Message Deleted] Pin
John R. Shaw17-Apr-08 15:57
John R. Shaw17-Apr-08 15:57 
GeneralRe: Too many results Pin
Blue_Boy17-Apr-08 16:11
Blue_Boy17-Apr-08 16:11 
GeneralRe: Too many results Pin
John R. Shaw18-Apr-08 8:55
John R. Shaw18-Apr-08 8:55 
GeneralRe: Too many results Pin
Blue_Boy18-Apr-08 11:15
Blue_Boy18-Apr-08 11:15 
Generaldata transformation problem for serialised recordsets Pin
uglyeyes17-Apr-08 9:30
uglyeyes17-Apr-08 9:30 
hi!

I am having problem with my logic. i have set of records like below

id name num
100 A 1
100 A 2
100 A 3
100 A 4
100 A 46
100 A 47
200 A 3
200 A 4
200 A 5
300 A 1

the data is already ordered by id, name and num. I need to find min(num) and max(num) and group the records for serialised num's for example above record set should be transformed to 4 records as

id name num_min num_max
100 A 1 4
100 A 46 47
200 A 3 5
300 A 1 1

I am having really difficult time as in how my while/if else should work.
I am trying to solve using temp tables/while loop/if else statement. I am not allowed to use cursors. could someone help me how should i do it.

I put all the data in a temp table #tempsrc
set rowcount 1
get all 4 values in a variable
@id, @name, @num
delete the record
if @num+1<> select num from #tempsrc
begin
delete record
end
else
begin
end
while....
if

here is where my problems are could someone point me to right direction

many thanks in forward.
GeneralRe: data transformation problem for serialised recordsets Pin
Michael Potter17-Apr-08 10:08
Michael Potter17-Apr-08 10:08 
GeneralRe: data transformation problem for serialised recordsets Pin
uglyeyes17-Apr-08 13:23
uglyeyes17-Apr-08 13:23 
GeneralRe: data transformation problem for serialised recordsets Pin
Blue_Boy17-Apr-08 15:45
Blue_Boy17-Apr-08 15:45 
GeneralRe: data transformation problem for serialised recordsets Pin
uglyeyes17-Apr-08 16:48
uglyeyes17-Apr-08 16:48 
GeneralRe: data transformation problem for serialised recordsets Pin
Michael Potter18-Apr-08 3:57
Michael Potter18-Apr-08 3:57 
GeneralRe: data transformation problem for serialised recordsets Pin
uglyeyes19-Apr-08 17:26
uglyeyes19-Apr-08 17:26 
GeneralRe: data transformation problem for serialised recordsets Pin
Michael Potter21-Apr-08 3:22
Michael Potter21-Apr-08 3:22 
GeneralGrid sorting wont work on live server (Godaddy) [modified] Pin
AlexeiXX317-Apr-08 5:42
AlexeiXX317-Apr-08 5:42 
Questionhow to change the date 5 th dec 2008 to default date in sqlserver2000? Pin
subbu.sk17-Apr-08 3:59
subbu.sk17-Apr-08 3:59 
AnswerRe: how to change the date 5 th dec 2008 to default date in sqlserver2000? [modified] Pin
Blue_Boy17-Apr-08 15:59
Blue_Boy17-Apr-08 15:59 
GeneralRe: how to change the date 5 th dec 2008 to default date in sqlserver2000? Pin
subbu.sk17-Apr-08 20:03
subbu.sk17-Apr-08 20:03 
GeneralINSERT trigger - how to stop the insert from happening. Pin
Paddy Boyd17-Apr-08 3:53
Paddy Boyd17-Apr-08 3:53 
GeneralRe: INSERT trigger - how to stop the insert from happening. Pin
Werries17-Apr-08 9:56
Werries17-Apr-08 9:56 
GeneralRe: INSERT trigger - how to stop the insert from happening. Pin
SimulationofSai17-Apr-08 21:22
SimulationofSai17-Apr-08 21:22 
GeneralSystem.Data.OleDb.OleDbException: Unspecified error Pin
tom8317-Apr-08 3:35
tom8317-Apr-08 3:35 
GeneralRe: System.Data.OleDb.OleDbException: Unspecified error Pin
Kschuler17-Apr-08 10:37
Kschuler17-Apr-08 10:37 
Generalline 18 is getting error near ''this codes(mysql) Pin
srinivassam17-Apr-08 0:53
srinivassam17-Apr-08 0:53 

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.