Creating a custom SQL query gives you the ability to flexibly present the data in a table in any way you wish using SQL features like calculated columns, aggregation, formatting, filtering, joins and lookups.

Permissions: To create a custom SQL query, you must have both the "Editor" role (or higher) and one of the developer roles "Platform Developer" or "Trusted Analyst".

The following steps guide you through creating a custom SQL query and view on a data table.

Create a Custom SQL Query

  • Select (Admin) > Go To Module > Query.
  • From the schema list, select the schema that includes your data tables of interest.
  • Click the Create New Query button.
  • In the field What do you want to call the new query?, enter a name for your new query.
  • In the drop-down field Which query/table do you want this new query to be based on?, select the base query/table for your query.
  • Click Create and Edit Source.
  • LabKey Server will generate an SQL query for the selected table.
  • Refine the source of this query as desired in the SQL source editor.

Related Topics


Was this content helpful?

Log in or register an account to provide feedback

expand all collapse all