"jose isaias cabrera" <[EMAIL PROTECTED]> wrote:
> Greetings!
> 
> I have this schema,
> 
> CREATE TABLE LSOpenJobs
>         (
>          id integer primary key, ProjID, parent, children, login, cust, 
> proj, PClass, PSubClass, bdate, ddate, edate, pm, pmuk, lang, vendor, 
> vEmail, invoice, ProjFund, A_No, wDir, notes, status
>         );
> 
> When I do a,
> 
> SELECT * FROM LSOpenJobs WHERE status='o' ORDER BY ProjID, PSubClass, 
> parent, bdate, ddate, edate;
> 
> the ORDERing, or sorting, is done alphabetically and not numerically.  Is 
> there a possibility to get this ORDER BY done numberically?  ProjID is an 
> integer, and so I end up with this,
> 

The easiest way to do this is to say "ProjID INTEGER" instead of
just "ProjID" in your CREATE TABLE statement.

Another approach is to say "CAST(ProjId AS INTEGER)" instead of
just "ProjID" in the ORDER BY clause.  But this second approach
will silently convert non-integer strings into zero, which might
not be exactly what you want to do with them.

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to