Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I've got a unusual question.
The human resources needs to export an old DB to a new one.
And the guys managing the new DB wants one csv file with every dataset existing. I did a Relational database and now i find it difficult to write the select statement.

I did this:

SELECT *
FROM teilnehmer, personen, seminare, termine, kategorien, haeuser
WHERE teilnehmer.sid = seminare.sid  
AND teilnehmer.pid = personen.pid  
AND termine.sid = seminare.sid  
AND seminare.katid = kategorien.katid  
AND personen.hausid = haeuser.hausid
ORDER BY personen.pid

but i only get ~1500 entrys. I know thats to little, because when i look for a Name and all the workshops he/she did, i get much more than what is in this export.

I don't need the answer i would appreciate if someone could give me a little hint in how to get this done. Till yet i had only like one join for the data i'd needed to display but this confuses me.

share|improve this question

1 Answer 1

My guess is you need to specify the type of join. You really want a "full outer join" which will not exclude records. A select where you join by keys will default to an inner join.

See http://stackoverflow.com/a/6188334/259538

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.