Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: DBI problem on fetchrow

by jZed (Prior)
on Nov 15, 2007 at 17:36 UTC ( #651033=note: print w/replies, xml ) Need Help??


in reply to Re: DBI problem on fetchrow
in thread DBI problem on fetchrow

That part of what the OP is doing is ok. "M" is being used as a table alias. SQL syntax supports table aliases either with or without the optional keyword "AS", so these two are the same, they both let you refer to "Regions" as "M":
SELECT M.foo FROM Regions AS M; SELECT M.foo FROM Regions M;

Replies are listed 'Best First'.
Re^3: DBI problem on fetchrow
by Jenda (Abbot) on Nov 15, 2007 at 17:55 UTC

    As a matter of style I would recomend using the "as" consistently. It reads better.

    BTW, "Regions as M"? Maybe there is a reason to use M for the Regions table, but I would expect R or (in case the table was used several times in the query) something like R_old, R_new, R1, R2, .... In either case I do not see why would you use an alias in a query that only includes one table. I guess a matter of style again :-)

      I agree. I always use AS.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://651033]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2017-02-25 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (366 votes). Check out past polls.