The SELECT statement is used to retrieve records from a table in the MongoDB database. You can choose, single, multiple or all records from a table by using different keywords.
Syntax:
SELECT expressions
FROM tables
[WHERE conditions];
FROM clause indicates the table or tables from which to retrieve rows.
The SELECT statement can be used with UNION statement, ORDER BY clause, LIMIT clause, WHERE clause, GROUP BY clause, HAVING clause, etc.
SELECT [ ALL | DISTINCT ]
expressions
FROM tables
[WHERE conditions]
[GROUP BY expressions]
[HAVING condition]
[ORDER BY expression [ ASC | DESC ]];
Example
We have a table "Students", having some data. So retrieve all records from "Students".
SELECT * FROM Students;
Mariadb Select data 1