29.10.2014 Views

Extracting data from the Synergetic database

Extracting data from the Synergetic database

Extracting data from the Synergetic database

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Common duplication problems<br />

Common duplication problems<br />

Example 1<br />

Duplicate names can be caused by forgetting to select StudentContactType as SC1 so that you are<br />

only picking up <strong>the</strong> primary contacts and not Term and Alternate as well. O<strong>the</strong>rwise, you would be<br />

returning one line for every contact that a student has.<br />

Query with duplicate records<br />

SELECT ID, StudentContactMailName, StudentContactAddressComma, StudentContactType<br />

FROM vStudentContactAddress<br />

WHERE CurrentSemesterOnlyFlag = 1<br />

Returns<br />

ID ContactMailName ContactAddress ContactType<br />

364 Mr Joe Black 15 Green St, MT WAVERLEY VIC 3149 SC1<br />

364 Mrs Jane Black 341 Flowerdale Ave, St Kilda VIC 3182 SC2<br />

Query with correction<br />

SELECT ID, StudentContactMailName, StudentContactAddressComma, StudentContactType<br />

FROM vStudentContactAddress, StudentContact<br />

WHERE CurrentSemesterOnlyFlag = 1 AND NormalMailFlag = 1<br />

Returns<br />

ID ContactMailName ContactAddress ContactType<br />

364 Mr Joe Black 15 Green St, MT WAVERLEY VIC 3149 SC1<br />

Page 6-38 Version 60

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!