Skip to content

SQL list comma option

Tako Lee edited this page Feb 21, 2014 · 11 revisions

Comma option is used to set style of comma in list items, so it's valid only when used with list option.

  • After item

    SELECT Name,ProductNumber,ListPrice AS Price
    FROM Production.Product 
    ORDER BY Name ASC;
    SELECT Name, 
           ProductNumber, 
           ListPrice AS Price
    FROM Production.Product
  • After item and followed by a space

    SELECT Name, ProductNumber, ListPrice AS Price
    FROM Production.Product 
    ORDER BY Name ASC;
  • Before item

    SELECT Name
          ,ProductNumber
          ,ListPrice AS Price
    FROM Production.Product
  • Before item and preceded by 1 or n space(s)

    SELECT Name
         , ProductNumber
         , ListPrice AS Price
    FROM Production.Product
Clone this wiki locally