CodeIgniter Forums

Full Version: How to Print Single Name
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Help me out to fetch only single store Data to below mentioned SQL queries

Code:
select
affiliateURL as url,
`store`.`name`
from
`store`
inner join
`store_coupon_junction` as `scj` on `store`.`id` = `scj`.`storeId` and `scj`.`storeCouponRank` >= 0
inner join
`category_coupon_junction` as `ccj` on `scj`.`couponId` = `ccj`.`couponId` and `ccj`.`categoryCouponRank` >= 0
inner join
`category` on `ccj`.`categoryId` = `category`.`id` and `category`.`active` = 1
inner join
`coupon` on `scj`.`couponId` = `coupon`.`id` and `coupon`.`active` = 1 and `coupon`.`type` != ''
where
`store`.`active` = 1
order by
`store`.`rank` desc
Please use the [code] tag to format your message so it's readable.
You will probably need to add a "group by". Something like "group by affiliateURL, store.name".
did you get any solution ?
limit 1