Advertisements
Advertisements
प्रश्न
Differentiate between COUNT() and COURT(*) functions in MYSQL. Give suitable examples to support your answer.
अंतर स्पष्ट करें
Advertisements
उत्तर
| count() | count(*) |
| To find the number of rows in a given column, use the count() method. NULL values are not included in the count() function's count. | To count every row that contains null values, utilise the count(*) method. |
For example: Five rows, including one with null values, make up the following table.
Demo
| ID | Name |
| 1 | Ajeem |
| 2 | NULL |
| 3 | Koyal |
| 4 | Saira |
Mysql>Select count(Name) from Demo; will return 3, but
Mysql>Select count(*) from Demo; will return 4
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
