Created
December 14, 2017 02:38
-
-
Save shyuan/db1eda24e98c8c1e344018f7b237a3ee to your computer and use it in GitHub Desktop.
計算某欄位是否為 NULL 的資料筆數
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT IF( ISNULL(deleted_at), 'NO', 'YES') AS is_deleted, COUNT(1) FROM xx_table GROUP BY is_deleted; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment