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

Database

 
GeneralRe: Testing on a Null value Pin
Colin Angus Mackay22-Dec-05 11:07
Colin Angus Mackay22-Dec-05 11:07 
AnswerRe: Testing on a Null value Pin
gharry22-Dec-05 10:26
gharry22-Dec-05 10:26 
QuestionConnecting to a remote DB from a service Pin
Marc Clifton22-Dec-05 4:12
mvaMarc Clifton22-Dec-05 4:12 
AnswerRe: Connecting to a remote DB from a service Pin
enjoycrack22-Dec-05 22:02
enjoycrack22-Dec-05 22:02 
QuestionSelecting a range of sql query results Pin
Rama Sharma22-Dec-05 0:41
Rama Sharma22-Dec-05 0:41 
AnswerRe: Selecting a range of sql query results Pin
Colin Angus Mackay22-Dec-05 8:39
Colin Angus Mackay22-Dec-05 8:39 
QuestionTime consuming Stored Proc + Progress bar Pin
c121hains21-Dec-05 14:32
c121hains21-Dec-05 14:32 
QuestionSort without duplicates Pin
denpsia21-Dec-05 13:20
denpsia21-Dec-05 13:20 
Hi everybody,
I like to asked anyone who is very good at sql to help me display this data in a table format that duplicate headings, subheadings or other columns won't appear twice or more. Can anyone help me? I need to sort them and load them in a Datatable. Loop thorugh all records and display them in a label control created at run time. Thanks in advance.

I have posted this topic on other forums, some solutions given but they are using approach for .Net Framework 2.0, I am using .Net Framework 1.1. I am trying to avoid using a lot of select Distinct sql queries to database and looping the data to be able to remove duplicates. Do anyone knows another approach using less code and less sql access?

Sample Data:

Topics Table
TopicId TopicLevel Topic ParentId
1 1 First 0
2 1 AnotherFirst 0
3 2 Second 1
4 2 AnotherSecond 2
5 3 Third 3

Contents Table
ContentID Heading SubHeading SubSubHeading1 NumberText Names Content1 ParentId
1 How are you? Hello Someone 1 Ben some text 5
2 How are you? Hello Someone 1 John other text 5
3 How are you? Hello Anybody 2 Ben some text 5
4 How are you? Hello Anybody 2 Mike other text 5
5 How are you? Greet Anywhere 1 Ben some text 5
6 How are you? Greet Anywhere 1 Luke some text 5
7 I miss you. Really When null null some text 5
8 I miss you. Really When null null some text 5

Display Format:
How are you?
----------------------------------------------
Hello
-----------------------------------------------
1 Someone
----------------------------------------------
Ben some text
---------------------------------------------
John other text
---------------------------------------------
2 Anybody
---------------------------------------------
Ben some text
---------------------------------------------
Mike other text
--------------------------------------------
Greet
-------------------------------------------------
1 Anywhere
-----------------------------------
Ben some text
-------------------------------------
Luke some text
================================================
I miss you
--------------------------------------------------
Really
------------------------------------------------
When
-----------------------------------------------
some text
----------------------------------------
some text
------------------------------------------


denpsia

-- modified at 19:33 Wednesday 21st December, 2005
AnswerRe: Sort without duplicates Pin
toxcct21-Dec-05 21:47
toxcct21-Dec-05 21:47 
GeneralRe: Sort without duplicates Pin
denpsia22-Dec-05 13:09
denpsia22-Dec-05 13:09 
GeneralRe: Sort without duplicates Pin
toxcct22-Dec-05 21:11
toxcct22-Dec-05 21:11 
GeneralRe: Sort without duplicates Pin
denpsia26-Dec-05 12:53
denpsia26-Dec-05 12:53 
QuestionSql Pin
Mfirdous21-Dec-05 11:18
Mfirdous21-Dec-05 11:18 
AnswerRe: Sql Pin
Colin Angus Mackay22-Dec-05 8:36
Colin Angus Mackay22-Dec-05 8:36 
QuestionHorizontal merge Pin
djsdjsdjsdjs21-Dec-05 7:20
djsdjsdjsdjs21-Dec-05 7:20 
AnswerRe: Horizontal merge Pin
denpsia21-Dec-05 13:24
denpsia21-Dec-05 13:24 
GeneralRe: Horizontal merge Pin
djsdjsdjsdjs22-Dec-05 3:22
djsdjsdjsdjs22-Dec-05 3:22 
AnswerRe: Horizontal merge [edited] Pin
toxcct21-Dec-05 21:50
toxcct21-Dec-05 21:50 
GeneralRe: Horizontal merge Pin
djsdjsdjsdjs22-Dec-05 3:36
djsdjsdjsdjs22-Dec-05 3:36 
GeneralRe: Horizontal merge [edited] Pin
toxcct22-Dec-05 3:38
toxcct22-Dec-05 3:38 
QuestionADO.NET and mdb embedded query Pin
Sasuko21-Dec-05 6:16
Sasuko21-Dec-05 6:16 
AnswerRe: ADO.NET and mdb embedded query Pin
S. Akif Kamal27-Dec-05 20:36
S. Akif Kamal27-Dec-05 20:36 
QuestionUse Time-Only in query (with parameters) Pin
BenKona20-Dec-05 7:18
BenKona20-Dec-05 7:18 
AnswerRe: Use Time-Only in query (with parameters) Pin
anandss20-Dec-05 8:27
anandss20-Dec-05 8:27 
Questionserver and db report in asp Pin
karanba19-Dec-05 23:22
karanba19-Dec-05 23:22 

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.