Click here to Skip to main content
16,005,149 members
Home / Discussions / Database
   

Database

 
AnswerRe: Which is Faster and more apprpriate to use? Pin
Colin Angus Mackay11-Feb-06 13:34
Colin Angus Mackay11-Feb-06 13:34 
QuestionSQL : SubQuery Pin
dev_rfid10-Feb-06 21:06
dev_rfid10-Feb-06 21:06 
AnswerRe: SQL : SubQuery Pin
Colin Angus Mackay10-Feb-06 22:31
Colin Angus Mackay10-Feb-06 22:31 
GeneralRe: SQL : SubQuery Pin
dev_rfid10-Feb-06 23:14
dev_rfid10-Feb-06 23:14 
QuestionTable Splitting ? Pin
cbhkenshin10-Feb-06 18:48
cbhkenshin10-Feb-06 18:48 
AnswerRe: Table Splitting ? Pin
Colin Angus Mackay10-Feb-06 22:40
Colin Angus Mackay10-Feb-06 22:40 
QuestionHow to eliminate duplicate rows from a table? Pin
jkrao10-Feb-06 17:33
jkrao10-Feb-06 17:33 
AnswerRe: How to eliminate duplicate rows from a table? Pin
Colin Angus Mackay10-Feb-06 22:48
Colin Angus Mackay10-Feb-06 22:48 
You could try a SELECT with a GROUP BY clause containg every column name in your table, and the output columns having an additional COUNT(*)
For example:
SELECT Column1, Column2, Column3, COUNT(*)
FROM MyTable
GROUP BY Column1, Column2, Column3
ORDER BY DESC COUNT(*)


This will float all the duplicates to the top of the result set. If you have no primary key or unique constraint on any of the columns then you have no way to reliably delete only the duplicates automatically. You will need to take note of the duplicate rows and delete them manually. (Actually, I think there might be, but if you only have 9 duplicates, it would be faster to just do it manually)

I'm curious as to why you don't have a primary key on the table? I've never come across a situation where I'd leave out a primary key.

Does there look like a good candidate for a primary key? It might be a good idea to create one.

ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

QuestionDatabase design Pin
TheJudeDude10-Feb-06 13:25
TheJudeDude10-Feb-06 13:25 
AnswerRe: Database design Pin
Ben Meyers10-Feb-06 18:29
Ben Meyers10-Feb-06 18:29 
GeneralRe: Database design Pin
TheJudeDude11-Feb-06 0:56
TheJudeDude11-Feb-06 0:56 
GeneralRe: Database design Pin
Rob Graham11-Feb-06 5:11
Rob Graham11-Feb-06 5:11 
GeneralRe: Database design Pin
Ben Meyers11-Feb-06 9:42
Ben Meyers11-Feb-06 9:42 
GeneralRe: Database design Pin
TheJudeDude13-Feb-06 7:14
TheJudeDude13-Feb-06 7:14 
QuestionWrong values being stored to table Pin
TheJudeDude10-Feb-06 11:37
TheJudeDude10-Feb-06 11:37 
AnswerRe: Wrong values being stored to table Pin
Paul Conrad10-Feb-06 12:26
professionalPaul Conrad10-Feb-06 12:26 
GeneralRe: Wrong values being stored to table Pin
TheJudeDude10-Feb-06 12:30
TheJudeDude10-Feb-06 12:30 
GeneralRe: Wrong values being stored to table Pin
Paul Conrad10-Feb-06 12:36
professionalPaul Conrad10-Feb-06 12:36 
GeneralRe: Wrong values being stored to table Pin
TheJudeDude10-Feb-06 12:45
TheJudeDude10-Feb-06 12:45 
QuestionHow to change DataGridView row bg color if modified Pin
BambooMoon10-Feb-06 6:12
BambooMoon10-Feb-06 6:12 
QuestionSQL Pin
dev_rfid10-Feb-06 3:02
dev_rfid10-Feb-06 3:02 
AnswerRe: SQL Pin
Michael Potter10-Feb-06 3:30
Michael Potter10-Feb-06 3:30 
GeneralRe: SQL Pin
dev_rfid10-Feb-06 3:42
dev_rfid10-Feb-06 3:42 
GeneralRe: SQL Pin
Michael Potter10-Feb-06 8:25
Michael Potter10-Feb-06 8:25 
GeneralRe: SQL Pin
dev_rfid10-Feb-06 20:57
dev_rfid10-Feb-06 20:57 

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.