ERROR 1054 (42S22): Unknown column 'SearchWord' in 'field list'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rpnew
    New Member
    • Aug 2007
    • 189

    ERROR 1054 (42S22): Unknown column 'SearchWord' in 'field list'

    [CODE=Sql]
    select `SearchWord` as 'Search Word', `SearchEngine` as 'Search Engine', `DomainName` as 'Domain Name', `Pos` as Position , `Link` as URL, `date` as 'Date Time' UNION select SearchWord,Sear chEngine,Domain Name,Pos,Link,d ate into outfile '/root/Desktop/data.csv' fields terminated by ',' from tempsearch;
    [/CODE]
    Well i hope title explains the problem.
    Tell me what is the problem in this query. Here i'm trying to export mysql data into csv file with header. I've done this before as well, but cant find what is problem in this query. :(

    Regards,
    RP
  • rpnew
    New Member
    • Aug 2007
    • 189

    #2
    Hi,
    Found the solution.
    [CODE=mysql]
    select 'SearchWord' as 'Search Word', 'SearchEngine' as 'Search Engine', 'DomainName' as 'Domain Name', 'Pos' as 'Position' , 'Link' as 'URL', 'date' as 'Date Time' UNION select SearchWord,Sear chEngine,Domain Name,Pos,Link,d ate from tempsearch into outfile '/root/Desktop/data.csv' fields terminated by ',';
    [/CODE]

    Comment

    Working...