Domanda

Sorry for my lame question I am new to the databases and SQL, Is the any SQL command for the finding out how many people are living in london from the database below?

.....................
Name      | City   
.....................
John      | London  
Watson    | New York  
Sherlock  | London  
Holmes    | Berlin  
Mycroft   | innsbruck  
.....................

Secondly, are the commands for PostgresSQL, MySQL, SQLlite same?

Thanks!

È stato utile?

Soluzione

You need to figure out the syntax difference of queries in various DBMS (MySQL , Postgres and SQLLite).

In my opinion this query should be similar in all three DBMS.

SELECT COUNT(Name) AS "No of Peoples" FROM TableName WHERE City = 'London';

Altri suggerimenti

Select count(name) from your_db_name where city='London'

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top