SELECT p.int_id, p.productname, p.weight, p.colorcode, p.float_amount,p.productmrp, p.mrp_price, pa.name, pa.orderID, p.currency_code, p.currency_symbol,p.topsale,p.topsalepercentage FROM todaysale ts LEFT JOIN products p ON ts.product_id = p.int_id LEFT JOIN product_photo_album pa ON p.int_id = pa.sid AND pa.orderID = 1 where p.product_quantity >0 and ts.shopid=1 ORDER BY rand()