【发布时间】:2015-01-12 22:08:44
【问题描述】:
我有以下查询可以正常工作,但不知道 :: 在 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
【问题讨论】:
-
这里有几个related questions,但它们似乎与PostgreSQL有关。
-
1什么时候不大于0?
-
@Strawberry:我相信是周二下午。
标签: postgresql