http://qs321.pair.com?node_id=651033


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.