的SQLite3:括号不能在子查询中不允许使用除和工会
问题描述:
我做SQLite中以下查询:的SQLite3:括号不能在子查询中不允许使用除和工会
select * from filenames f
where (f.filesize,f.checksum) in
(
select g.filesize,g.checksum from filenames g
where g.volume = 'Media'
except
select * from OnNNNMedia
union
select * from OnNNNTV
)
and f.volume='Media'
该查询运行良好,但有一个逻辑问题,因为except
是union
之前,虽然我希望它执行之后执行。
如果我在union
的周围加上括号以确保它先执行,请参阅下面的查询,我得到一个语法错误,抱怨新的括号。
select * from filenames f
where (f.filesize,f.checksum) in
(
select g.filesize,g.checksum from filenames g where g.volume = 'Media'
except
(
select * from OnNNNMedia
union
select * from OnNNNTV
)
)
and f.volume='Media'
OnNNNMedia
和OnNNNTV
是返回意见的文件大小,校验和对