delete_status = ? and car_type != ? and ul.client_id!=? and  delete_status = ?  and  car_type != ?  and  daily_price_status=? and ul.client_id in (select client_id from `clients` where emirate like  ?) and  car_model IN (?) and  car_make IN (?,?,?,?,?,?,?,?,?,?,?,?,?) and  car_make IN (?,?,?,?,?,?,?,?,?,?,?,?,?) and ul.client_id!=?and cl.emirate=? and ul.delete_status = ? and ul.publish_ocd = ?
Array
(
    [0] => 0
    [1] => 2
    [2] => 247
    [3] => 0
    [4] => 2
    [5] => 1
    [6] => %Dubai%
    [7] => 33
    [8] => 196
    [9] => 564
    [10] => 598
    [11] => 670
    [12] => 963
    [13] => 1040
    [14] => 1217
    [15] => 1413
    [16] => 865
    [17] => 1438
    [18] => 4731
    [19] => 1040
    [20] => 196
    [21] => 196
    [22] => 564
    [23] => 598
    [24] => 670
    [25] => 963
    [26] => 1040
    [27] => 1217
    [28] => 1413
    [29] => 865
    [30] => 1438
    [31] => 4731
    [32] => 1040
    [33] => 196
    [34] => 247
    [35] => Dubai
    [36] => 0
    [37] => 1
)

SELECT cs.car_spec_id specId, cs.car_spec_name specName, count(ul.id) listingCount
        FROM `usedcar_listings` ul  JOIN car_specs cs on cs.car_spec_id = ul.`car_spec_id` JOIN  clients cl on cl.client_id=ul.client_id
        WHERE  delete_status = ? and car_type != ? and ul.client_id!=? and  delete_status = ?  and  car_type != ?  and  daily_price_status=? and ul.client_id in (select client_id from `clients` where emirate like  ?) and  car_model IN (?) and  car_make IN (?,?,?,?,?,?,?,?,?,?,?,?,?) and  car_make IN (?,?,?,?,?,?,?,?,?,?,?,?,?) and ul.client_id!=?and cl.emirate=? and ul.delete_status = ? and ul.publish_ocd = ?  GROUP by cs.car_spec_id ORDER BY 
        CASE WHEN cs.car_spec_name = 'GCC Specs' THEN 0 ELSE 1 END, cs.car_spec_name ASC