

What you get is a list of distinct names: SELECT DISTINCT first_name FROM customers What it returns is a table of names where the names can obviously repeat:īut when you write the query with DISTINCT: SELECT DISTINCT eliminates any repeated documents from the output. With Studio 3T 2019.1, SQL Query now also supports the SELECT DISTINCT clause. This means we can also make use of any mongo operator. The keyword new is optional in data type constructors. You can also use a wide array of mongo data type constructors such as NumberInt, NumberLong, NumberDecimal, ObjectId, ISODate, Date, LUUID, CSUUID, JUUID, PYUUID, UUID, Timestamp, Symbol, DBRef, BinDate, and HexData. As strings, they can be quoted with single-quotes (”) or double-quotes (“”), which means these two queries are the same: JSON can be used in SQL WHERE clauses in two ways: SELECT _id, foo FROM bar JSON objects in WHERE clauses To restore _id and thus make the result editable, we ask for this specific field:


Which does not return _id, the result is not editable (no _id means no link to the original document). Pressing ‘Enter’ will write the new value to the database, while pressing ‘Esc’ will return the previous value and exit the editor. To edit a particular field or value in a document, simply double-click on it and a type-specific editor for that value will be activated. That is, rather than having to search for the documents you want to edit and then issue separate UPDATE, DELETE or INSERT commands, you can simply edit the documents directly inline. Edit results inlineĮditing documents and data in the SQL tab in Studio 3T is based on a ‘search and edit’ paradigm. In the screenshot above, only the first query appears underneath the SQL Query tab because it is the SQL statement executed at cursor. It shows the specific query that was actually run, important in the case of a SQL batch that contains multiple queries. The SQL Query tab shows which SQL query was executed by the text cursor (or “at cursor”). Similar to our IntelliShell, Studio 3T’s built-in mongo shell, SQL Editor detects and suggests standard SQL functions as well as fields, collections, and keyword names. SQL Query also supports smart auto-completion. Hotkey – Press F5 to execute SQL statement at cursor.Right-click – Place the cursor on the desired query, right-click, and choose Execute SQL statement at cursor.Button – Click on the Execute SQL statement marked by the cursor (play) button.You can execute a SQL statement in three ways:
#Aqua data studio tutorial download
Download Studio 3T here and write your own SQL queries as you go through the tutorial.
