Computer Science, asked by bhoomika6269, 11 months ago

Difference between total number of rows and distinct rows in sql server

Answers

Answered by amritanshu9649
4
I'm new to SQL, wasn't able to write the correct SQL. Given a table STATION that holds data for five fields namely ID, CITY, STATE, NORTHERN LATITUDE and WESTERN LONGITUDE.

+-------------+------------+ | Field | Type | +-------------+------------+ | ID | INTEGER | | CITY | VARCHAR(21)| | STATE | VARCHAR(2) | | LAT_N | NUMERIC | | LONG_W | NUMERIC | +-------------+------------+

Let NUM be the number of cities and NUMunique be the number of unique cities, then write a query to print the value of NUM - NUMunique.

Similar questions