Click here to Skip to main content
       

Database

 
AnswerRe: Does Adapter.GetData read all data? (noob) PinmemberMark J. Miller22-Feb-07 3:26 
GeneralConditional constraints PinmemberBrady Kelly21-Feb-07 8:06 
GeneralRe: Conditional constraints PinmemberMark J. Miller22-Feb-07 3:19 
QuestionMRD PinmemberRyno Burger21-Feb-07 6:43 
QuestionGrouping data from SQL in ASP PinmemberJennGom21-Feb-07 6:16 
AnswerRe: Grouping data from SQL in ASP Pinmemberandyharman21-Feb-07 8:15 
GeneralRe: Grouping data from SQL in ASP PinmemberJennGom21-Feb-07 9:27 
QuestionRetain Benefits of Non-Normalized Table Pinmemberperlmunger21-Feb-07 4:54 
I normalized a table in a database project I'm working on so that instead of having something like this:
 
Table: entities
-----------------
ID            NAME           RELATED_ITEM_ID_1        RELATED_ITEM_ID_2 ..... RELATED_ITEM_ID_40
1             Entity 1              1                          24                  67
2             Entity 3              14                         NULL                45
I now have something like these two tables:
Table: entities
-----------------
ID            NAME     
1             Entity 1 
2             Entity 3 
 
Table: entity_items
-----------------
ENTITY_ID        RELATED_ITEM_ID
1                       1
1                       24
1                       67
2                       14
2                       45
I want to return a table that has a summary of the entities table returning the top three entity_items so that it will come back looking like the original (non-normalized) entities table.
 
I am using a MySQL database, but any help with the basic concepts and SQL here would be appreciated. I'm sure this is a common problem people deal with, but I didn't even know the terminology to use to find an answer on the web.
 
Thanks.
 
-Matt

 
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall

AnswerRe: Retain Benefits of Non-Normalized Table PinmemberMark J. Miller22-Feb-07 3:00 
GeneralRe: Retain Benefits of Non-Normalized Table Pinmemberperlmunger22-Feb-07 4:50 
QuestionWhat is wrong with my SQL string? PinmemberB Journey21-Feb-07 3:16 
AnswerRe: What is wrong with my SQL string? PinmvpColin Angus Mackay21-Feb-07 3:19 
GeneralRe: What is wrong with my SQL string? PinmemberB Journey21-Feb-07 3:36 
GeneralRe: What is wrong with my SQL string? PinmvpColin Angus Mackay21-Feb-07 3:55 
GeneralRe: What is wrong with my SQL string? PinmemberB Journey21-Feb-07 4:31 
GeneralRe: What is wrong with my SQL string? Pinmemberpeterchen21-Feb-07 11:51 
GeneralRe: What is wrong with my SQL string? PinmemberPete O'Hanlon21-Feb-07 4:46 
AnswerRe: What is wrong with my SQL string? Pinmemberkubben21-Feb-07 3:27 
GeneralUpdate Advice - Getting most recent value PinmemberBrady Kelly21-Feb-07 2:15 
GeneralRe: Update Advice - Getting most recent value Pinmemberandyharman21-Feb-07 2:25 
GeneralRe: Update Advice - Getting most recent value PinmemberBrady Kelly21-Feb-07 2:58 
Questionsome question Pinmemberimrankhanpathan21-Feb-07 1:04 
AnswerRe: some question Pinmemberandyharman21-Feb-07 2:38 
QuestionAverage of all columns PinmemberSam Heller20-Feb-07 11:11 
AnswerRe: Average of all columns PinmemberKrish - KP20-Feb-07 17:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 29 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid