Hi all,
I am using SQL Server 2005 and have the following T-SQL query:
tiMNMmbrno looks distinct until about 200 rows down, then dupes of that member # show up with 2 different <ttMNMnincr> and <tvMNMrelat>. So, the record itself is not distinct, but I only want distinct member #'s to show up. Any ideas?
Thanks!
Brett
I am using SQL Server 2005 and have the following T-SQL query:
Code:
SELECT DISTINCT tiMNMmbrno, ttMNMnincr, tvMNMntype, tvMNMrelat, tvMMBclass, tsMMBmyear, tvMMBmpref,
tcMNMfirst, tcMNMmidle, tcMNMlastn, tvMNMgnrtn, tcMADline1, tcMADline2, tcMADline3, tcMADcityn,
tvMADstate, tcMADzipc5, tcMADzipc4, tsMCOmcnty, tcMCOcname, ttMCOfbreg, ttMCOfbdst, tcMTOtname,
ttMTOrtwnp, PhoneType, Faxnum, tcMEMemail
FROM vw_MMB_Membership
WHERE tsMMBmyear=2008 AND (tvMMBclass='01' OR tvMMBclass='21' OR
tvMMBclass='31' OR tvMMBclass='51') AND tvMNMrelat<>'30' AND
tsMCMcyear=2008 and
((tvMCMcomno ='0051' AND tvMCMposno='0002') OR
(tvMCMcomno='0051' AND tvMCMposno='0003') OR
(tvMCMcomno='0051' AND tvMCMposno='0005') OR
(tvMCMcomno='0051' AND tvMCMposno='0010') OR
(tvMCMcomno='0053' AND tvMCMposno='0005') OR
(tvMCMcomno='0054' AND tvMCMposno='0005') OR
(tvMCMcomno='0055' AND tvMCMposno='0005') OR
(tvMCMcomno='0060' AND tvMCMposno='0005') OR
(tvMCMcomno='0086' AND tvMCMposno='0005') OR
tvMCMcomno='0047' OR
tvMCMcomno='0048' OR
tvMCMcomno='0049' OR
tvMCMcomno='0059')
tiMNMmbrno looks distinct until about 200 rows down, then dupes of that member # show up with 2 different <ttMNMnincr> and <tvMNMrelat>. So, the record itself is not distinct, but I only want distinct member #'s to show up. Any ideas?
Thanks!
Brett