Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ALL is default. Returns all values.

Example


Code Block
SELECT ALL state 
   FROM zips


Back to top

COUNT(DISTINCT <field>)

...

SELECT COUNT(DISTINCT <field>) FROM <collection_name>

Example


Code Block
SELECT COUNT(DISTINCT state) FROM zips


Back to top

FROM clause

Determines the specific dataset to examine to retrieve data. For MongoDB, this would be indicated as a specific Collection. 

...

where the database name is qa and the collection name is testArray.

Example


Code Block
SELECT * 
   FROM zips 
Info

There is no JOIN support in MongoSQL. Only one collection can be specified in a FROM statement. The following query:

SELECT * FROM baseball A, basketball B WHERE city IN ['Chicago'] AND A.city=B.city

would generate an error.


Back to top

WHERE clause

The WHERE clause, sometimes called the predicate, states the qualifying conditions for a query. Multiple conditions can be joined by boolean AND and OR clauses, optionally surrounded by (parentheses) to group them.

...