Question : how select and inner join when count(*) > 1

I have a table that might have duplicate data except for the date, and I want to inner join the data in that table with another table and when the one table has more than 1 row I want to select the one with the Greater date.
Here is what I've got so far:

select l.leadID, l.customerID, l.email, l.datecreated as DateLeadCreated, c.datesent as EmailSent,
   l.custdate as DateBecameCustomer
  from Leads l
  inner join Campaign c
  on c.leadID = l.leadID
  where l.customerID is not null
  and l.custdate > c.datesent
  order by l.customerid

but this shows me both leadid records in Campaign...I only want the one with the greater date in datesent.

select MAX(datesent) from Campaign group by leadID having COUNT(*) > 1


 

Answer : how select and inner join when count(*) > 1

Hi While1-Breathe,
The issue results because of the IE ClearType rendering and there are actually many fixes for it apart from the one in the link you provided.

The issue results from specifying a width & opacity filter for the same element, while if the width was specified for a parent element it won't happen.

Also Arial font is the worst case, while if you use Tahoma for example it would look a lot better though it's still not using the fix

Finally applying the background should work even for <li> elements but if you specify the background color to an upper level than the one having the opacity applied to it won't work, for example if you have an <li> with a class where filter is applied, setting the background for the <ul> won't fix it, but the opposite would.

Try the below example, it should show you many cases and check which one would work best for you.

Cheers
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
<div style="font:normal 14px Arial, Helvetica, Serif;">
        <div style="background-color:#fff">
            <ul style="width:100%;filter:alpha(opacity=90);font-weight:bold;">
                <li>This is not working</li>
            </ul>
        </div>
        <div style="width:100%;filter:alpha(opacity=90);font-weight:bold;">
            <ul style="background-color:#fff">
                <li>This is working!</li>
            </ul>
        </div>
        <div>
            <ul style="width:100%;">
                <li style="filter:alpha(opacity=90);font-weight:bold;">This is working too with no fix required since no width is specified for the element but instead it's specified for the UL</li>
                <li style="filter:alpha(opacity=90);font-weight:bold;width:100%">while this doesn't although they're both &lt;li&gt; elements but this one has a width specified</li>
                <li style="filter:alpha(opacity=90);font-weight:bold;font-family:Tahoma;">Tahoma Font Working</li>
                <li style="filter:alpha(opacity=90);font-weight:bold;font-family:Tahoma;width:100%">Tahoma Font not Working which still looks much better than Arial</li>
            </ul>
        </div>
    </div>
Random Solutions  
 
programming4us programming4us