【发布时间】:2013-10-02 13:43:08
【问题描述】:
使用以下 sql 进行搜索的 mysql 查询
SELECT societa.nome, documenti.document, soieditor.nominativo, document_revision.*
FROM document_revision
JOIN societa ON societa.id = document_revision.societa
JOIN documenti ON documenti.id = document_revision.tipo_document
JOIN soieditor ON soieditor.id = document_revision.createdby
WHERE document_revision.id in(
(
(SELECT id from document_revision WHERE `description` LIKE '%f%' OR `tag` LIKE '%f%' OR `lingua` LIKE '%f%')
union
(SELECT doc_rev_id from document_metadata WHERE `met_key` LIKE '%f%' OR `meta_value` LIKE '%f%')
union
(SELECT doc_id from document_files WHERE `file_name` LIKE '%f%')))
给我以下错误 '#1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以了解在 'union (SELECT doc_rev_id from document_metadata WHERE met_key LIKE '%fwdfdfdfd' at line 1' 附近使用的正确语法"
请帮我解决错误。
【问题讨论】: