$sql = "SELECT
ar.AR_CODE,ar.AR_NAME,ar.STAF_CODE,c.AR_CODE,COUNT(c.id) as aaa
FROM ar_master ar LEFT JOIN (chat c)
ON (c.AR_CODE=ar.AR_CODE)
ORDER BY aaa
Tag : PHP, MySQL, HTML/CSS, Ajax, jQuery
Date :
2016-11-29 15:55:09
By :
benzsara
View :
741
Reply :
2
No. 1
Guest
..... ลูกค้า JOIN แชท ON ลูกค้า.id = แชท.id_cus ........
$sql = "SELECT
ar.AR_CODE,ar.STAF_CODE,ar.AR_NAME,COUNT(c.AR_CODE) aaa
FROM ar_master ar LEFT JOIN (chat c)
ON (ar.AR_CODE=c.AR_CODE)
ORDER BY aaa DESC
";