{/* Table of contents */}
@@ -557,26 +591,35 @@ function TRQLGuideContent() {
Select columns from a table. Use
* to select all columns,
or list specific columns.
-
+ onTryExample(
+ `SELECT run_id, task_identifier, status
+FROM runs
+LIMIT 10`,
+ "environment"
+ )
+ }
/>
-
+
Alias columns with AS:
-
+ onTryExample(
+ `SELECT task_identifier AS task, count() AS total
+FROM runs
+GROUP BY task`,
+ "environment"
+ )
+ }
+ className="mt-1"
/>
@@ -589,19 +632,23 @@ GROUP BY task`}
>, <=,{" "}
>=
- now() - INTERVAL 1 DAY`}
- language="sql"
- showLineNumbers={false}
- showOpenInModal={false}
- className="text-xs"
+ onTry={() =>
+ onTryExample(
+ `SELECT * FROM runs
+WHERE status = 'Failed'
+ AND created_at > now() - INTERVAL 1 DAY`,
+ "environment"
+ )
+ }
/>
-
+
Other operators:
-
@@ -630,15 +674,20 @@ WHERE completed_at IS NOT NULL`}
Sort results with ORDER BY (ASC/DESC). Limit results with{" "}
LIMIT.
-
+ onTryExample(
+ `SELECT run_id, compute_cost, created_at
+FROM runs
+ORDER BY compute_cost DESC, created_at ASC
+LIMIT 50`,
+ "environment"
+ )
+ }
/>
@@ -649,7 +698,7 @@ LIMIT 50`}
Use GROUP BY with aggregate functions. Filter groups with{" "}
HAVING.
- 10
ORDER BY run_count DESC`}
- language="sql"
- showLineNumbers={false}
- showOpenInModal={false}
- className="text-xs"
+ onTry={() =>
+ onTryExample(
+ `SELECT
+ task_identifier,
+ status,
+ count() AS run_count,
+ avg(usage_duration) AS avg_duration
+FROM runs
+GROUP BY task_identifier, status
+HAVING run_count > 10
+ORDER BY run_count DESC`,
+ "environment"
+ )
+ }
/>
@@ -859,21 +918,10 @@ function ExamplesContent({
{example.description}
- onTryExample(example.query, example.scope)}
/>
-
))}