Found which record having duplicate records

SELECT count(MerchantID), RelationID  FROM `WebsiteURLRelation` WHERE ISNULL(DealsID) AND UrlID=4 GROUP BY MerchantID  HAVING COUNT(MerchantID) > 1

Advertisements

SUM

This will set count value if NULL else retun the max value + 1

SELECT IFNULL((MAX(Rank)+1), 1) RANK FROM `deal_rank` WHERE ISHomeorHoliday IN (1,2);

————————————————————————————————————————————–

THIS IS FOR CHANGING THE DATE FORMATE

DATE_FORMAT(Deals.ExpireDate, ‘%Y-%m-%d %H:%i:%s’)

————————————————————————————————————————————–

THIS WILL RETURN FIRST NON NULL VALUE : if Name is null it returns Username else Unknown

COALESCE(Name, Username, ‘Unknown’)

Good curve design

<style>
.progress {
border: 1px solid #DDDDDD;
border-radius: 13px 13px 13px 13px;
padding: 1px;
position: relative;
text-align: center;
width: 400px;
margin-top:10px;
}

.curveMe {
border: #B3B3B3 1px solid;
text-shadow: 0 1px 0 #FFFFFF;
color: #464646;
font-size: 13px !important;
line-height: 13px;
padding: 10px 30px;
text-decoration: none;
-moz-border-radius: 11px;
border-radius: 11px;
background: #ffffff;
background-image: -webkit-gradient(linear, left bottom,left top,color-stop(0, rgb(235,235,235)),color-stop(1, rgb(255,255,255)));
background-image: -moz-linear-gradient(center bottom,rgb(235,235,235) 0%,rgb(255,255,255) 100%);
}
</style>

demo-curve-img