generated SQLs.

This commit is contained in:
Kazu Yamamoto 2014-12-20 14:53:39 +09:00
parent d158f27ef8
commit 3c81e9a635

View File

@ -49,6 +49,14 @@ account_3_7_1 = relation $ do
return a return a
{% endhighlight %} {% endhighlight %}
Generated SQL:
{% highlight sql %}
SELECT ALL T0.account_id AS f0, T0.product_cd AS f1, T0.open_date AS
f2, T0.avail_balance AS f3 FROM MAIN.account T0 ORDER BY
T0.avail_balance DESC
{% endhighlight %}
#### Sorting via numeric placeholders #### Sorting via numeric placeholders
For backwards compatibility with the SQL92 version of standard, you can use numbers instead of names to specify the columns that should be sorted. With HRR you cannot use numbers for such purpose. For backwards compatibility with the SQL92 version of standard, you can use numbers instead of names to specify the columns that should be sorted. With HRR you cannot use numbers for such purpose.
@ -86,6 +94,14 @@ data Employee1 = Employee1
$(makeRecordPersistableDefault ''Employee1) $(makeRecordPersistableDefault ''Employee1)
{% endhighlight %} {% endhighlight %}
Generated SQL:
{% highlight sql %}
SELECT ALL T0.emp_id AS f0, T0.title AS f1, T0.start_date AS f2,
T0.fname AS f3, T0.lname AS f4 FROM MAIN.employee T0 ORDER BY T0.title
ASC, T0.lname ASC
{% endhighlight %}
#### The order by clause #### The order by clause
SQL: SQL: