This is not really a perlish question, although I am developing a Web App using Perl, Class::DBI and the Template Toolkit. Its more a SQL question, and so excuse me if I've run the wrong way.
First off - Is there any way to specify a "order by" phrase in the retrieve_all method of the Class::DBI module? Is there any way, I can specify the 'ASC' or 'DESC' words, apart from using retrieve_from_sql?
Now for the SQL!
I have the following 2 tables:
Table customer:
| code | name | region |
|---|---|---|
| 1 | Me | 1 |
| 2 | Myself | 2 |
| 3 | You | 3 |
| id | name |
|---|---|
| 1 | Mumbai |
| 2 | Delhi |
| 3 | Chennai |
Now I would like to sort and retrieve the customer table, based on region name and not on region id, which the following SQL statement does:
SELECT * FROM customer ORDER BY region
I tried the following:
SELECT customer.* FROM customer, region ORDER BY region.name
but i'm getting horribly stuck!
Any help would be most welcome.
Thankz
--
arc_of_descent
In reply to Class::DBI and sql order by by arc_of_descent
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |