{"id":65112,"date":"2024-01-25T13:44:46","date_gmt":"2024-01-25T05:44:46","guid":{"rendered":"https:\/\/oihelp.corporate.ifs.com\/help\/?page_id=65112"},"modified":"2026-09-07T18:39:39","modified_gmt":"2026-09-07T10:39:39","slug":"dataset-query-language-dql","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/connecting-your-data\/creating-a-dataset-datasource\/dataset-query-language-dql\/","title":{"rendered":"Dataset Query Language (DQL)"},"content":{"rendered":"\n<p class=\"intro-text\">DQL or Dataset Query Language is using a mixture of SQL and SER syntax and allows executing queries on datasets (matrices) just like on a table in a database.<\/p>\n<p class=\"note\">Note: All processing is done in memory, so memory consumption can become an issue.<\/p>\n<h2 class=\"page-subheading\">Syntax Format<\/h2>\n<p class=\"intro-text\">All DQL queries start with <span class=\"code-fragment\">{dq'select<\/span> and end with <span class=\"code-fragment\">'}<\/span>\u00a0<\/p>\n<p class=\"intro-text\">Example: <span class=\"code-fragment\"><strong>{dq'select<\/strong> * from source<strong>'}<\/strong><\/span><\/p>\n<h3>Expression Syntax<\/h3>\n<p class=\"intro-text\">Where supported, expressions in all clauses follow the syntax of the <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/calculation-syntax\/\">Calculation Engine<\/a> instead of SQL.\u00a0This means that, for example:<\/p>\n<ul>\n<li class=\"intro-text\">The == operator has to be used for equality checks instead of = (like in SQL).<\/li>\n<li class=\"intro-text\">Strings can use single quote, double quote or the Str() format.<\/li>\n<li class=\"intro-text\">Parameters are accessible (param[xyz]).<\/li>\n<li class=\"intro-text\">Durations and times can be declared with the usual syntax ({du'xyz'} and {utc'xyz'} syntax).<\/li>\n<li class=\"intro-text\">Operators behave like they do in the calculation engine (time + integer results in time increased by number of seconds), and so on.<\/li>\n<\/ul>\n<h3>Inline Dataset Syntax<\/h3>\n<p class=\"intro-text\">Inline datasets allow you to hard-code a dataset by using the <strong>values<\/strong> keyword, instead of fetching it from an external system. In clauses which accept inline datasets, the syntax is as follows.<\/p>\n<p class=\"intro-text\"><strong><span style=\"color: #0000ff;\">(values<\/span><\/strong> (Row1Col1,Row1Col2)<span style=\"color: #0000ff;\">,<\/span> (Row2Col1,Row2Col2) ,...<strong><span style=\"color: #0000ff;\">)<\/span><\/strong> TableName <strong><span style=\"color: #0000ff;\">(<\/span><\/strong>Column1Name, Column2Name ,...<strong><span style=\"color: #0000ff;\">)<\/span><\/strong><\/p>\n<p class=\"intro-text\">In the syntax model, after \"values\":<\/p>\n<ul class=\"intro-text\">\n<li>First you list all your rows. The number of values for each row ((Row1Value1, Row1Value2) etc), must match the number of columns you have.<\/li>\n<li>Then you give the dataset a name.<\/li>\n<li>And finally you list the name of the columns.<\/li>\n<\/ul>\n<p class=\"intro-text\">Note: Any names that contain special characters can be escaped by using square brackets e.g. [Table Name]<\/p>\n<p class=\"intro-text\">Here is an example:<\/p>\n<p class=\"intro-text\">Table Name: <strong>Cause<\/strong><\/p>\n<table style=\"width: 50%;\">\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Cause<\/strong><\/td>\n<td><b>Id<\/b><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td>Planned<\/td>\n<td>1<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td>Unplanned<\/td>\n<td>2<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"intro-text\">For the example table above, the syntax would be as follows:<\/p>\n<p class=\"intro-text code-fragment\">(values (\"Planned\", 1), (\"Unplanned\", 2)) Cause (Cause, Id)<\/p>\n<hr \/>\n<h2 class=\"page-subheading\">Supported Clauses<\/h2>\n<h3>Example Dataset<\/h3>\n<p class=\"intro-text\">In the following examples we will use this dataset, named \"<strong>Downtime<\/strong>\":<\/p>\n<table style=\"width: 50%;\">\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 421px;\"><strong>Location<\/strong><\/td>\n<td style=\"width: 379px;\"><b>CauseId<\/b><\/td>\n<td style=\"width: 159px;\"><b>DowntimeHours<\/b><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 421px;\">Michigan<\/td>\n<td style=\"width: 379px;\">1<\/td>\n<td style=\"width: 159px;\">45<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 421px;\">Texas<\/td>\n<td style=\"width: 379px;\">1<\/td>\n<td style=\"width: 159px;\">712<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 421px;\">Wyoming<\/td>\n<td style=\"width: 379px;\">2<\/td>\n<td style=\"width: 159px;\">130<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 421px;\">Michigan<\/td>\n<td style=\"width: 379px;\">2<\/td>\n<td style=\"width: 159px;\">176<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>select<\/h3>\n<p class=\"intro-text\">The list of columns or expressions to return from a named dataset in <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/connecting-your-data\/creating-a-dataset-datasource\/how-to-write-a-dataset-query\/how-to-write-a-paged-query\/\">IFS OI<\/a>\u00a0Server. This clause is required in all queries and supports the following features:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody class=\"intro-text\">\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 14.6875%;\"><strong>Feature<\/strong><\/td>\n<td style=\"width: 26.302%;\"><strong>Returns<\/strong><\/td>\n<td style=\"width: 2.13537%;\"><strong>Format<\/strong><\/td>\n<td style=\"width: 29.5833%;\"><strong>Example<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 14.6875%;\">asterisk<\/td>\n<td style=\"width: 26.302%;\">All columns from all datasets<\/td>\n<td style=\"width: 2.13537%;\"><span style=\"color: #ff00ff;\">*<\/span><\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select <\/strong><span style=\"color: #ff00ff;\">* <\/span><strong>from<\/strong> Downtime<strong>'}<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 14.6875%;\">prefixed asterisk<\/td>\n<td style=\"width: 26.302%;\">All columns of the specified dataset<\/td>\n<td style=\"width: 2.13537%;\">datasetName<span style=\"color: #ff00ff;\">.*<\/span><\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select<\/strong> Downtime<span style=\"color: #ff00ff;\">.* <\/span><strong>from<\/strong> Downtime<strong>'}<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 14.6875%;\">column name<\/td>\n<td style=\"width: 26.302%;\">The specified column from any of the datasets as long as the column name is unique across all datasets<\/td>\n<td style=\"width: 2.13537%;\">columnName<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select <\/strong>Location <strong>from <\/strong>Downtime<strong>'}<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 14.6875%;\">prefixed column name<\/td>\n<td style=\"width: 26.302%;\">The specified column from the specified dataset<\/td>\n<td style=\"width: 2.13537%;\">datasetName<span style=\"color: #ff00ff;\">.<\/span>columnName<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select <\/strong>Downtime<span style=\"color: #ff00ff;\">.<\/span>Location<strong>\u00a0from <\/strong>Downtime<strong>'}<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 14.6875%;\">expression<\/td>\n<td style=\"width: 26.302%;\">The result of the expression as a column<\/td>\n<td style=\"width: 2.13537%;\">Any valid expression that can be parsed by the <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/calculation-syntax\/\">calculation engine<\/a> on a dataset column<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select <\/strong>DowntimeHours<span style=\"color: #ff00ff;\">*<\/span><span style=\"color: #99cc00;\">2<\/span><strong> from <\/strong>Downtime<strong>'}<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 14.6875%;\">alias<\/td>\n<td style=\"width: 26.302%;\">Specifies an alias\/name for the column<\/td>\n<td style=\"width: 2.13537%;\">columnName <strong>as <\/strong><span style=\"color: #ff00ff;\">[<\/span>alias<span style=\"color: #ff00ff;\">]<\/span><\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select <\/strong>DowntimeHours<strong> as\u00a0 <\/strong><span style=\"color: #ff00ff;\">[<\/span>Downtime Hours<span style=\"color: #ff00ff;\">]<\/span> <strong>from\u00a0 <\/strong>Downtime<strong>'}<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>from<\/h3>\n<p class=\"intro-text\">\u00a0The source dataset of the query, which can be either a named dataset in <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/connecting-your-data\/creating-a-dataset-datasource\/how-to-write-a-dataset-query\/how-to-write-a-paged-query\/\">IFS OI<\/a>\u00a0Server or an Inline Dataset (see above for syntax). Supported features are:\u00a0<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody class=\"intro-text\">\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\"><strong>Feature<\/strong><\/td>\n<td style=\"width: 13.6458%;\"><strong>Description<\/strong><\/td>\n<td style=\"width: 13.6458%;\"><strong>Format<\/strong><\/td>\n<td style=\"width: 29.5833%;\"><strong>Example<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\">dataset reference or inline dataset<\/td>\n<td style=\"width: 13.6458%;\">Fetches the specified dataset and uses it as the source of the query<\/td>\n<td style=\"width: 13.6458%;\"><strong>from <\/strong>source<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select<\/strong> * <strong>from <\/strong>Downtime<strong>'}<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\">alias<\/td>\n<td style=\"width: 13.6458%;\">Specifies an alias\/name for the dataset<\/td>\n<td style=\"width: 13.6458%;\"><strong>from <\/strong>source <strong>as<\/strong> <span style=\"color: #ff00ff;\">[<\/span>alias<span style=\"color: #ff00ff;\">]<\/span><\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select<\/strong> * <strong>from <\/strong>Downtime <strong>as <\/strong><span style=\"color: #ff00ff;\">[<\/span>Monthly Downtime<span style=\"color: #ff00ff;\">]<\/span><strong>'}<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>join<\/h3>\n<p class=\"intro-text\">\u00a0Allows joining other datasets to the source of the query, which can be either a named dataset in <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/connecting-your-data\/creating-a-dataset-datasource\/how-to-write-a-dataset-query\/how-to-write-a-paged-query\/\">IFS OI<\/a>\u00a0Server or an Inline Dataset (see above for syntax). Supported features are:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody class=\"intro-text\">\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\"><strong>Feature<\/strong><\/td>\n<td style=\"width: 26.5625%;\"><strong>Description<\/strong><\/td>\n<td style=\"width: 27.2917%;\"><strong>Format<\/strong><\/td>\n<td style=\"width: 29.5833%;\"><strong>Example<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\">inner join<br \/>\nleft join<br \/>\nright join<br \/>\nfull join<\/td>\n<td style=\"width: 26.5625%;\">Standard SQL syntax for multiple types of joins<\/td>\n<td style=\"width: 27.2917%;\">joinType source <strong>on\u00a0 <\/strong>joinCondition<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select <\/strong><span style=\"color: #ff00ff;\">*<\/span> <strong>from<\/strong> Downtime <strong>inner join<\/strong> Cause <strong>on<\/strong> Downtime<span style=\"color: #ff00ff;\">.<\/span>CauseId <span style=\"color: #ff00ff;\">==<\/span> Cause<span style=\"color: #ff00ff;\">.<\/span>Id<strong>'}<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\">cross join<\/td>\n<td style=\"width: 26.5625%;\">Standard SQL syntax for cross joins<\/td>\n<td style=\"width: 27.2917%;\"><strong>cross join<\/strong> source<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select <\/strong><span style=\"color: #ff00ff;\">*<\/span><strong> from\u00a0 <\/strong>Downtime <strong>cross join <\/strong>Cause<strong>'}<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\">alias<\/td>\n<td style=\"width: 26.5625%;\">Specifies an alias\/name for the joined dataset. The alias is specified directly after the dataset name.<\/td>\n<td style=\"width: 27.2917%;\">dataset1Name ds1Alias<br \/>\nds1Alias<span style=\"color: #ff00ff;\">.<\/span>column<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select <\/strong><span style=\"color: #ff00ff;\">*<\/span><strong> from <\/strong>Downtime dt<strong>\u00a0inner join <\/strong>Cause cd <strong>on <\/strong>dt<span style=\"color: #ff00ff;\">.<\/span>CauseId <span style=\"color: #ff00ff;\">==<\/span> cd<span style=\"color: #ff00ff;\">.<\/span>Id<strong>'}<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\">expression<\/td>\n<td style=\"width: 26.5625%;\">Specifies a condition for finding joined rows<\/td>\n<td style=\"width: 27.2917%;\">Any valid expression that can be parsed by the <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/calculation-syntax\/\">calculation engine<\/a> on a dataset column<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select <\/strong><span style=\"color: #ff00ff;\">*<\/span><strong> from <\/strong><span style=\"color: #ff00ff;\">(<\/span><strong>values<\/strong> <span style=\"color: #ff00ff;\">(<span style=\"color: #0000ff;\">\"<\/span><\/span><span style=\"color: #0000ff;\">one\"<\/span><span style=\"color: #ff00ff;\">),<\/span> <span style=\"color: #ff00ff;\">(<\/span><span style=\"color: #0000ff;\">\"two\"<\/span><span style=\"color: #ff00ff;\">), (<\/span>Str<span style=\"color: #ff00ff;\">(<\/span>three<span style=\"color: #ff00ff;\">)), (<\/span><span style=\"color: #0000ff;\">\"four\"<\/span><span style=\"color: #ff00ff;\">))<\/span> inlineParent <span style=\"color: #ff00ff;\">(<\/span><strong>Value<\/strong><span style=\"color: #ff00ff;\">)<\/span><strong> left join <\/strong><span style=\"color: #ff00ff;\">(<\/span><strong>values<\/strong> <span style=\"color: #ff00ff;\">(<\/span><span style=\"color: #99cc00;\">1<\/span><span style=\"color: #ff00ff;\">), (<\/span><span style=\"color: #99cc00;\">2<\/span><span style=\"color: #ff00ff;\">), (<\/span><span style=\"color: #99cc00;\">3<\/span><span style=\"color: #ff00ff;\">), (<\/span><span style=\"color: #99cc00;\">4<\/span><span style=\"color: #ff00ff;\">))<\/span> inlineChild <span style=\"color: #ff00ff;\">(<\/span>ChildId<span style=\"color: #ff00ff;\">)<\/span><strong> on <\/strong>inlineParent<span style=\"color: #ff00ff;\">.<\/span>Value <span style=\"color: #ff00ff;\">==<\/span> <span style=\"color: #0000ff;\">\"one\"<\/span> <strong>or <\/strong>inlineParent.Value <span style=\"color: #ff00ff;\">==<\/span> Str<span style=\"color: #ff00ff;\">(<\/span>two<span style=\"color: #ff00ff;\">)<\/span> <strong>or<\/strong> inlineParent.Value <span style=\"color: #ff00ff;\">==<\/span> <span style=\"color: #0000ff;\">\"three\"<strong>'}<\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Join Types<\/p>\n<\/h4>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2026\/09\/join-type.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-72619\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2026\/09\/join-type-1080x161.png\" alt=\"\" width=\"990\" height=\"148\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2026\/09\/join-type-1080x161.png 1080w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2026\/09\/join-type-600x89.png 600w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2026\/09\/join-type-150x22.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2026\/09\/join-type-768x115.png 768w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2026\/09\/join-type-1536x229.png 1536w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2026\/09\/join-type-1210x180.png 1210w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2026\/09\/join-type-48x7.png 48w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2026\/09\/join-type.png 1623w\" sizes=\"auto, (max-width: 990px) 100vw, 990px\" \/><\/a><\/p>\n<table style=\"border-collapse: collapse; width: 99.863%;\">\n<tbody class=\"intro-text\">\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 2.44381%;\">Left Join<\/td>\n<td style=\"width: 39.1702%;\">Returns all records from the left dataset and matching records from the right dataset.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 2.44381%;\">Right Join<\/td>\n<td style=\"width: 39.1702%;\">Returns all records from the right dataset and matching records from the left dataset.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 2.44381%;\">Inner Join<\/td>\n<td style=\"width: 39.1702%;\">Returns only records with matching values in both datasets.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 2.44381%;\">Full Join<\/td>\n<td style=\"width: 39.1702%;\">Returns all records from both datasets, including matching and non-matching records.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 2.44381%;\">Feature<\/td>\n<td style=\"width: 39.1702%;\">Returns all rows from both datasets without using a join condition.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>where<\/h3>\n<p class=\"intro-text\">\u00a0Filters the rows of the query. Supported features are:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody class=\"intro-text\">\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\"><strong>Feature<\/strong><\/td>\n<td style=\"width: 26.5625%;\"><strong>Description<\/strong><\/td>\n<td style=\"width: 27.2917%;\"><strong>Format<\/strong><\/td>\n<td style=\"width: 29.5833%;\"><strong>Example<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\">expression<\/td>\n<td style=\"width: 26.5625%;\">The expression\/condition to apply to the rows<\/td>\n<td style=\"width: 27.2917%;\">Any valid expression that can be parsed by the <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/calculation-syntax\/\">calculation engine<\/a> on a dataset column<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select <\/strong><span style=\"color: #ff00ff;\">*<\/span><strong> from\u00a0 <\/strong>Downtime <strong>where <\/strong><span style=\"color: #ff00ff;\">(<\/span>DowntimeHours <span style=\"color: #ff00ff;\">&gt;<\/span> <span style=\"color: #99cc00;\">4<\/span> <strong>or<\/strong> Location <span style=\"color: #ff00ff;\">==<\/span> <span style=\"color: #0000ff;\">\"Texas\"<\/span><span style=\"color: #ff00ff;\">)<\/span><strong>'}<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>order by<\/h3>\n<p class=\"intro-text\">Sorts the rows of the query. Ordering can be ascending (default) or descending (desc). Supported features are:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody class=\"intro-text\">\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\"><strong>Feature<\/strong><\/td>\n<td style=\"width: 26.5625%;\"><strong>Description<\/strong><\/td>\n<td style=\"width: 27.2917%;\"><strong>Format<\/strong><\/td>\n<td style=\"width: 29.5833%;\"><strong>Example<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\">By column<\/td>\n<td style=\"width: 26.5625%;\">Sorts the results according to the specified column name<\/td>\n<td style=\"width: 27.2917%;\"><strong>order by<\/strong> columnName<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select<\/strong> <span style=\"color: #ff00ff;\">*<\/span> <strong>from<\/strong> Downtime <strong>order by<\/strong> DowntimeHours<strong>'}<\/strong><br \/>\n<strong>{dq'select<\/strong> <span style=\"color: #ff00ff;\">*<\/span> <strong>from<\/strong> Downtime <strong>order by<\/strong> DowntimeHours <strong>desc'}<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\">By expression<\/td>\n<td style=\"width: 26.5625%;\">Sorts the results according to the specified expression<\/td>\n<td style=\"width: 27.2917%;\">Any valid expression that can be parsed by the <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/calculation-syntax\/\">calculation engine<\/a> on a dataset column<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select<\/strong> <span style=\"color: #ff00ff;\">*<\/span> <strong>from<\/strong> Downtime\u00a0 <strong>order by<\/strong> DowntimeHours <span style=\"color: #ff00ff;\">&gt;<\/span> <span style=\"color: #99cc00;\">25.5<\/span><strong>'}<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 16.5625%;\">By list of items<\/td>\n<td style=\"width: 26.5625%;\">Comma separated list of column names and\/or expressions<\/td>\n<td style=\"width: 27.2917%;\"><strong>order by<\/strong> columnName, ...<\/td>\n<td style=\"width: 29.5833%;\"><strong>{dq'select<\/strong> <span style=\"color: #ff00ff;\">*<\/span> <strong>from<\/strong> Downtime\u00a0 <strong>order by<\/strong> Location <strong>desc<\/strong><span style=\"color: #ff00ff;\">,<\/span> DowntimeHours<strong>'}<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Examples<\/h2>\n<p class=\"intro-text\">Query: <span class=\"code-fragment\">{dq'select * from Downtime'}<\/span><br \/>\nResult: Return all columns and rows from the Downtime dataset.<\/p>\n<p class=\"intro-text\">Query: <span class=\"code-fragment\">{dq'select * from [Downtime] as [dt]'}<\/span><br \/>\nResult:\u00a0 Same as the previous but with an alias and with identifiers escaped.<\/p>\n<p class=\"intro-text\">Query: <span class=\"code-fragment\">{dq'select * from (values (1, \"One\"), (2, \"Two\"), (3, \"Three\")) [source] (Id, [Name])'}<\/span><br \/>\nResult: Return all rows and columns from an inline dataset which has 2 columns (Id and Name) and 3 rows.<\/p>\n<p class=\"intro-text\">Query: <span class=\"code-fragment\">{dq'select * from Downtime cross join Cause'}<\/span><br \/>\nResult: Cross join of 2 datasets.<\/p>\n<p class=\"intro-text\">Query: <span class=\"code-fragment\">{dq'select * from Downtime cross join (values (1, \"Inline 1\"), (2, \"Inline 2\")) inlineDataset(Id, Location)'}<\/span><br \/>\nResult: Cross join between a fetched dataset and an inline dataset.<\/p>\n<p class=\"intro-text\">Query: <span class=\"code-fragment\">{dq'select * from Downtime dt left join (values (1, \"Inline 1\"), (param[dtHrs] - 6, \"Inline 2\")) [inlineDataset] ([Id], [Location]) on dt.CauseId == inlineDataset.Id'}<\/span><br \/>\nResult: Left join between a fetched dataset and an inline dataset.<\/p>\n<p class=\"intro-text\">Query: <span class=\"code-fragment\">{dq'select * from Downtime where (DowntimeHours &gt; 4 or Location == \"Texas\")'}<\/span><br \/>\nResult: Filtering rows by multiple conditions.<\/p>\n<p class=\"intro-text\">Query: <span class=\"code-fragment\">{dq'select true, {utc''2023-01-30 14:38:24''}, 123.456, {du''07:08''}, 901, ''single quote string'' [Single Quote String], \"double quote string\" as [Double Quote String], Str(wrapped string) WrappedString'}<\/span><br \/>\nResult: Testing some specific syntax (with no from clause).<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DQL or Dataset Query Language is using a mixture of SQL and SER syntax and allows executing queries on datasets (matrices) just like on a table in a database.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/connecting-your-data\/creating-a-dataset-datasource\/dataset-query-language-dql\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":23931,"parent":3692,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[9],"tags":[1166,129,356],"class_list":["post-65112","page","type-page","status-publish","has-post-thumbnail","hentry","category-tech-ref","tag-dql","tag-queries","tag-syntax","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/65112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/comments?post=65112"}],"version-history":[{"count":48,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/65112\/revisions"}],"predecessor-version":[{"id":72620,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/65112\/revisions\/72620"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/3692"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media\/23931"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=65112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=65112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=65112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}