SQL Query Removing Dups -


using goldmine crm , wrote query try , find out people in our system based on record type, lead creation date , last contact date. when running query brings multiple results john smith showing me of information rather last contacted date want. i'll paste query below appreciated.

select distinct contact1.contact    contact_name,                  min(contact1.contact),                  contact1.key1       rec_type,                  contact1.createon   lead_type,                  conthist.lastdate   last_contact,                  conthist.resultcode stamp    contact1         inner join conthist                 on contact1.accountno = conthist.accountno   contact1.key1 = 'lead'  group  contact1.contact,            contact1.key1,            contact1.createon,            conthist.lastdate,            conthist.resultcode  having count(contact1.contact) = 1  order  contact1.createon  


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -