Monday 20 February 2017

use of aggregate function count in SQL

Let  be the number of CITY entries in STATION, and let  be the number of distinct CITY names in STATION; query the value of  from STATION. In other words, find the difference between the total number of CITY entries in the table and the number of distinct CITY entries in the table.
Input Format
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
query:
select count(city)- count( distinct city)
from station ;

No comments:

Post a Comment