How do I use GROUP BY in the SelectCommand?
Here is my querty.
SELECT distinct(concat(u.unit, u.prop)) as tmp, u.prop, u.unit, t.tnt_name, u.curr_tenant,
u.future_tenant, u.owner, u.past_tenant, u.rent_rate, t.status
FROM db.table1 t AS u
LEFT JOIN db.table2 as t
ON u.prop=t.prop AND u.unit=t.unit
WHERE u.prop != “” AND (t.status != “P” OR u.status != “P”)
GROUP BY tmp
ORDER BY u.prop ASC, u.unit ASC
When I take out the GROUP BY tmp, it shows me the record, but when I put back the GROUP BY tmp, it give me 0 result.
Can you help me with this?
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top