If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Database redundant records... need hlep

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-04, 15:34
kicker22 kicker22 is offline
Registered User
 
Join Date: Apr 2004
Location: Michigan
Posts: 44
Database redundant records... need hlep

I am working on this access DB that has been created by some consulting firm couple of years ago, which I wasnt here at that time.

The DB is being by college faculty members to store about students who study abroad..
now,
there are students who has more than one major.. and when I run query to find out how many students are studying abroad..
it shows me more than the actual number of students who are studying abroad, because it shows same student twice because of double major..
In other words, it inserts two records for a student who has 2 majors into the DB.

Now my question is, is it possible to combine 2 records into one record on query results?
I know you can do the following: SELECT StudentName = 'major + major'

but the problem is, the name for field major is the same.. so I cannot say in my query 'Major + Major' to combine 2 records. it doesnt work..

let me know if anyone has solution to this, that will be greatful...
thanks,

morad
Reply With Quote
  #2 (permalink)  
Old 04-09-04, 16:29
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
Not knowing what your column names are I'll give it a shot

SELECT count(distinct STUDENTNAME) from table;

assuming the only student names in the table are those studying abroad.

Now it doesn't matter if there is one row for guelphdad studying math and one for guelphdad studying music, only one of them is counted.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On