我在我的Rails應用程序的查詢,看起來像這樣: # Returns any records whose period intersect the specified time
# @see https://www.postgresql.org/docs/9.3/static/rangetypes.html
# @see https://www.postgresql.org/docs/9.3/
我認爲這可能是一個常見的問題,可能沒有每個工具的答案。現在我們正在嘗試使用amazons Redshift。我們現在唯一的問題是我們正在嘗試查找IP地址的郵政編碼。我們將IP連接到城市的表格是通過將IP轉換爲整數的範圍。 實施例: Start IP | End IP | City
| 123123 | 123129 | Rancho Cucamonga|
我曾嘗試明顯內部聯接上intip>
我有這個表在我的PostgreSQL: CREATE TABLE visits(
id BIGSERIAL NOT NULL PRIMARY KEY,
timeslot TSRANGE NOT NULL,
user_id INTEGER NOT NULL REFERENCES users(id),
CONSTRAINT overlapping_timeslots EXCLUDE USING