Skip to content

Select Columns

agershun edited this page Dec 28, 2014 · 4 revisions

SELECT columns

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
    SEELCT `My Column`   -- MySQL style
Clone this wiki locally