1
我有另一个需要转换为postgres的sqlite脚本。采取甘德,如果你能帮助:)将sqlite转换为postgres
SELECT count(*), strftime('%H', sentdate) as hour FROM latency l, contacts me
WHERE l.lat < 1 and datetime(sentdate) > datetime('2009-01-01') and datetime(sentdate)
< datetime('2011-02-01') and (me.id = l.replyuid or me.id = l.senduid)
GROUP BY hour ORDER BY hour asc;
如果我写此查询,我可能会尝试做这个一个内部连接(而不是逗号连接),并且由于在连接条件中有一个'or',我将它表示为一个联合,相同的查询,但也许更习惯于SQL。 – SingleNegationElimination
@TokenMacGuy - 够真实的。我非常喜欢ANSI加入,但是我试图不偏离原始查询太远... – gsiems