Laravel COUNT with IF condition and DISTINCT

2021/09/28閱讀時間約 1 分鐘
在某些條件下COUNT且指定欄位value重複只算一次:
DB::raw('COUNT(DISTINCT IF(contact_result.invalid_flag = "Y", customer.customer_id, NULL)) AS contact_invalid_count')
為什麼會看到廣告
20會員
161內容數
留言0
查看全部
發表第一個留言支持創作者!