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

Database

 
GeneralRe: Grouping Results by ElectionName Pin
samflex19-Mar-14 13:12
samflex19-Mar-14 13:12 
GeneralRe: Grouping Results by ElectionName Pin
Mycroft Holmes19-Mar-14 14:05
professionalMycroft Holmes19-Mar-14 14:05 
GeneralRe: Grouping Results by ElectionName Pin
samflex19-Mar-14 14:13
samflex19-Mar-14 14:13 
GeneralSSIS - Truncation may occur due to inserting data Pin
Smith201418-Mar-14 2:59
Smith201418-Mar-14 2:59 
AnswerRe: SSIS - Truncation may occur due to inserting data Pin
Kornfeld Eliyahu Peter18-Mar-14 3:00
professionalKornfeld Eliyahu Peter18-Mar-14 3:00 
GeneralRe: SSIS - Truncation may occur due to inserting data Pin
Smith201418-Mar-14 3:07
Smith201418-Mar-14 3:07 
AnswerRe: SSIS - Truncation may occur due to inserting data Pin
Kornfeld Eliyahu Peter18-Mar-14 3:11
professionalKornfeld Eliyahu Peter18-Mar-14 3:11 
GeneralRe: SSIS - Truncation may occur due to inserting data Pin
jschell18-Mar-14 8:44
jschell18-Mar-14 8:44 
GeneralRe: SSIS - Truncation may occur due to inserting data Pin
Mycroft Holmes18-Mar-14 12:55
professionalMycroft Holmes18-Mar-14 12:55 
QuestionSSIS - Truncation may occur due to inserting data Pin
Smith201418-Mar-14 2:54
Smith201418-Mar-14 2:54 
QuestionInserting a new record into 2 tables at the same time Pin
jkirkerx17-Mar-14 11:49
professionaljkirkerx17-Mar-14 11:49 
AnswerRe: Inserting a new record into 2 tables at the same time Pin
Mycroft Holmes17-Mar-14 19:48
professionalMycroft Holmes17-Mar-14 19:48 
GeneralRe: Inserting a new record into 2 tables at the same time Pin
jkirkerx19-Mar-14 13:21
professionaljkirkerx19-Mar-14 13:21 
GeneralRe: Inserting a new record into 2 tables at the same time Pin
Mycroft Holmes19-Mar-14 14:10
professionalMycroft Holmes19-Mar-14 14:10 
GeneralRe: Inserting a new record into 2 tables at the same time Pin
jkirkerx19-Mar-14 16:26
professionaljkirkerx19-Mar-14 16:26 
QuestionStructure Database Pin
sbangani15-Mar-14 5:29
sbangani15-Mar-14 5:29 
AnswerRe: Structure Database Pin
Richard Andrew x6415-Mar-14 10:55
professionalRichard Andrew x6415-Mar-14 10:55 
GeneralRe: Structure Database Pin
sbangani16-Mar-14 12:05
sbangani16-Mar-14 12:05 
AnswerRe: Structure Database Pin
Eddy Vluggen16-Mar-14 0:51
professionalEddy Vluggen16-Mar-14 0:51 
AnswerRe: Structure Database Pin
jschell17-Mar-14 8:37
jschell17-Mar-14 8:37 
QuestionGet Result according to comma seperated sequence Pin
Rupesh Kumar Swami15-Mar-14 4:04
Rupesh Kumar Swami15-Mar-14 4:04 
AnswerRe: Get Result according to comma seperated sequence Pin
Jörgen Andersson15-Mar-14 9:07
professionalJörgen Andersson15-Mar-14 9:07 
Maybe not the answer you're looking for, but your table doesn't even conform to the first normal form.
Normalize it, for example like this:
SQL
CREATE TABLE MyTable
	([fileid] int, [filesequence] int, [catid] int, [catsequence] int)
;
	
INSERT INTO MyTable
	([fileid], [filesequence], [catid], [catsequence])
VALUES
	(4, 1, 41, 2),
	(1, 2, 41, 2),
	(5, 3, 41, 2),
	(8, 4, 41, 2),
	(9, 5, 41, 2),
	(10, 6, 41, 2),
	(20, 7, 41, 2),
	(18, 1, 48, 9),
	(17, 2, 48, 9),
	(19, 3, 48, 9),
	(24, 4, 48, 9),
	(25, 5, 48, 9),
	(19, 1, 49, 10),
	(21, 2, 49, 10),
	(22, 3, 49, 10),
	(23, 4, 49, 10),
	(24, 5, 49, 10),
	(25, 6, 49, 10),
	(26, 7, 49, 10)
;
Now you can Query it like this:
SQL
select  fileid
from    mytable
group by fileid
order by min(catsequence),min(filesequence)

And the result will look like this:

FILEID
4 
1 
5 
8 
9 
10 
20 
18 
19 
17 
24 
25 
21 
22 
23 
26 
It's easy enough to make that into a comma separated file if you would really need to.
But that task actually belongs to another layer than the database.
Wrong is evil and must be defeated.
- Jeff Ello[^]

Questionget day wise records seperated by id Pin
Member 1026351913-Mar-14 20:23
Member 1026351913-Mar-14 20:23 
AnswerRe: get day wise records seperated by id Pin
Mycroft Holmes14-Mar-14 0:50
professionalMycroft Holmes14-Mar-14 0:50 
AnswerRe: get day wise records seperated by id Pin
Bernhard Hiller14-Mar-14 1:12
Bernhard Hiller14-Mar-14 1:12 

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.