why an "as" clause is needed in ...

  • in my book tsql sentences :

    select type, avgprice as avgprice

    into type avgprice

    from titles

    ...

    why "as avgprice" is needed in the tsql script? we just create a new table "typeavgprice"

  • This sql statement doesn't make sense? Did you mean select type, avg(price) as AvgPrice?

    If so, you need the "as" because that is the column identifier in the avgprice table. Otherwise, you wouldn't have a column name in the new table.

    Darren


    Darren

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply