semi OT : SQL syntax question

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Jun 29 11:55:08 EDT 2005


On 6/29/05 6:47 PM, "jbv" <jbv.silences at Club-Internet.fr> wrote:

> Trevor,
> 
> Thanks, but I found the solution in the mySQL manual
> about an hour ago... I was actually confusing the Postgres
> and mySQL syntax... stupid me...
> 
> However, why did you add "as myCol" ?
 
> I'm using :
> SELECT concat("$",ID,"$"), col_1, col_2 FROM myTable WHERE
> id < 100
> 
> and it works...

Because 

A) name can be used in the ORDER BY statement.
    if you have no name you still can do although
    
        ORDER BY 1

B) with name you get NICE name of column in the some GUI tool,

C) future you can access that column by name

    f1 = cursor.field( 1 )
    f1 = cursor.field( "myCol" )

Without name 

    f1 = cursor.field( "????" )   -- hard or impossible



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]





More information about the use-livecode mailing list