我偶然遇到了查询来计算SO声誉的CDF:
SELECT
Reputation,
SUM(COUNT(*)) OVER(
ORDER BY Reputation
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS UserCount
FROM
Users
GROUP BY Reputation
ORDER BY Reputation
我制作了自己的查询,看起来像
select reputation, cume_dist() over (order by reputation)
from users
gro
这些桌子看起来像这样:
Table: Shops
ShopCode ShopName
-------- --------
A Aladdin
B Backstreet
C Clerk's Store
D Debs Tool
Table: Sale
ShopCode Product
-------- -------
A Hammer
A Thermometer
A Compass
B Eraser
B Ha
我试图在BINANCE Futures上下一个2倍的杠杆订单,如下所示: (a) POST /fapi/v1/leverage with {'symbol':'ETHUSDT','leverage':2} (b) POST /fapi/v1/order,{‘数量’:100,...} 这是设置杠杆的正确方式吗?我不知道怎么证明它是有杠杆作用的。我在BINANCE FUTURES Web上看到的位置是2倍,但我不确定这是否足够。 卖我以前买的东西最好的方法是什么?我现在卖出了99,但总是有0.x的剩余。我是否应该结清头寸,而不是下另一个卖单? 谢谢
查询“所有以相同价格出售三种不同啤酒的酒吧?”
我的表是
卖( bar,啤酒,价格)-bar-外键..Bar( name,addr) -名称主键。
我想过这样的事情,但这种方法似乎有效……
Select A.bar As bar , B.bar as bar
From Sells AS A, Sells AS B
Where A.bar = B.bar and A.beer <> B.beer
Group By(A.beer)
Having Count(Distinct A.beer) >= 2
这是正确的SQL查询吗?