Skip to content

Select Columns

Mathias Rangel Wulff edited this page Jun 12, 2015 · 4 revisions

Keyword SELECT

Columns

    SELECT size
    SELECT City.Name, City.Population

Expressions

    SELECT LCASE(City), 2+2

Aggregators

    SELECT COUNT(*), SUM(Population)

Alias

    SELECT City+” “+Country AS LongName

Select all columns from table

    SELECT *, City.*

Select columns of arrays

    SELECT [0],[1] 

Column names with spaces, etc

    SELECT [My Column]   -- SQL Server style
    SELECT `My Column`   -- MySQL style
Clone this wiki locally