我有下面的查詢哪些工作正常,但不知道在postgresql中的含義和使用::
。任何人都可以解釋::在postgresql意義?
select (
select (
case when 1 > 0 then 1::float/(
select count(id) from transactions_products where transaction_id in (
select id from transactions_transactions tt
where status = 3 and fi = 355
and (invoice_date >= 1420754400)
and (invoice_date <= 1421099999)
and (tt.division_id = 107)
and (tt.department_id = 210)
) and is_vehicle = 1
)::float else 0 end)
limit 1) as f_4
爲什麼在這裏標記sqlite,當它顯然是一個Mysql相關的問題? – jarlh
這裏有幾個[相關問題](http://stackoverflow.com/questions/5758499/double-colon-notation-in-sql),但它們似乎與PostgreSQL有關。 – halfer
當1不大於0? – Strawberry