这是原始逻辑
(scrape_datas = ScrapeData.find(
:all, :conditions =>
"artist_status = 'NOT_FOUND'
AND blacklisted = 1
AND extracted = 0
and not EXISTS(
SELECT * FROM artist_name_suggestions where original = artist_name
)
我已经能够更好地分割第一部分
scrape_datas = ScrapeData.where(
:artist_status => 'NOT_FOUND',
:blacklisted => 1,
:extracted => 0
)
尽管在将“而不是 EXISTS”查询混入其中时遇到问题
and not EXISTS(
SELECT * FROM artist_name_suggestions where original = artist_name
)
谢谢!