T-SQL 101: 85 Counting rows and column values with COUNT
In previous posts, I looked at how to read data from a table. Now, we need to look at how we do calculations on the data in the table.
The most basic calculation we might do is to count the number of rows in the table. The first example above does that.
What about the asterisk?
But also notice that is has an asterisk in the query. Some people worry about the asterisk being in their queries as usually having an asterisk isn’t a good idea. In fact, some customers have automated systems for checking code, and the automated system might complain about the asterisk.
2021-02-15