2012-09-16 59 views
-1

工作我有這個疑問:SQL查詢MATCH無法用所選列

SELECT (
    *) 
    , 
    MATCH(table1.tags,table1.title,table1.description) AGAINST ('".$keywords."' IN BOOLEAN MODE) AS ideas_score 
    FROM table1 JOIN table2 ON table1.id_user = table2.id HAVING ideas_score > 0 
    ORDER BY ideas_score DESC; 

爲什麼如果我這樣做是不工作?

SELECT (
    table1.description, 
table1.title, 
    table1.id, 
    table1.id_user, 
    table1.tags, 
    table1.insert_datetime, 
    table2.fb_id, 
    table2.fb_aliasname, 
    table2.firstname, 
    table2.lastname) 
    , 
    MATCH(table1.tags,table1.title,table1.description) AGAINST ('".$keywords."' IN BOOLEAN MODE) AS ideas_score 
    FROM table1 JOIN table2 ON table1.id_user = table2.id HAVING ideas_score > 0 
    ORDER BY ideas_score DESC; 

我總是收到此錯誤:

Error Number: 1241 

Operand should contain 1 column(s) 

回答

-1

OMG對不起,我只注意到SELECT不需要()