SQL queries

01) join query:
select     products.productId, products.ProductName, products.IsApproved, products.ProductCode, products.ProductImage, products.ProductDescription, products.ProductCost,
        categorymaster.CategoryId, categorymaster.CategoryName
       
      FROM     products  INNER JOIN categorymaster  ON products.productId = categorymaster.CategoryId  where CategoryId='$id' and products.IsApproved='1' order by ProductId LIMIT $offset, $rowsPerPage";


02) count no of days in a month:
SELECT day(last_day('2011-02-1'));

today date:
SELECT DAY(CURRENT_DATE);

days between two date:
SELECT DATEDIFF('2006-07-10','2006-06-01');
Related Posts Plugin for WordPress, Blogger...

:: Useful web links List