|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Question about Duplicate Records
Hey -
Can someone help me? Basically i have a table with 37,000 records. Each record has the person reponsible name. Each name is used more than once. Whenever I preform the following SQL Query: SELECT YKPC_EXT_Orders.ACCOUNTANT, YKPC_EXT_Orders.FULL_NAME FROM YKPC_EXT_Orders; It displays a table with their full name and userid like its supposed to but it displays duplicates of each name. Say that persons name was in 30 records, it would display their name 30 times. Is there any way i could put a constraint on my SQL statement so when i run the query, it wont show each name more than once?? thanks |
|
#2
|
|||
|
|||
|
SELECT DISTINCT ykpc_ext_orders.accountant,
ykpc_ext_orders.full_name FROM ykpc_ext_orders; But this is just fighting the symptoms of a bad database design. Put your accountants into a separate table with user id and full name, and then store the user_id in the ykpc_ext_orders table. This is called "normalizing" |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Question about Duplicate Records |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|