Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2008
    Posts
    2

    Unanswered: get data from column with space

    Hello all,

    I was wondering how to get the data from a column when the column has a space. The column name is 'currency -'. Unfortunately I cannot get the data of this column. I already used single and double spaces, but that is also not the solution. Maybe somebody can help? Thanks.

  2. #2
    Join Date
    Dec 2005
    Posts
    273
    Put the column name in double quote.

    SELECT "currency -" FROM your-table


    keep in mind, that the column-name is case sensitiv if you use double quotes.

    SELECT "currency -" FROM your-table

    is not the same as

    SELECT "Currency -" FROM your-table
    Last edited by umayer; 08-04-08 at 10:43.

  3. #3
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    If you want to select "the data from a column when the column has a space",
    use:
    WHERE "currency -" LIKE '% %'
    or
    SELECT CASE WHEN "currency -" LIKE '% %' THEN "currency -" ELSE ... END

    and note what umayer said:
    keep in mind, that the column-name is case sensitiv if you use double quotes.

    SELECT "currency -" FROM your-table

    is not the same as

    SELECT "Currency -" FROM your-table

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •