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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
