真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

joinondifferentdatatype-創(chuàng)新互聯(lián)

SELECT ....
FROM A LEFT SEMI JOIN B
ON (A.col1 = B.col2)
WHERE ...
"
If A.col1 is of DOUBLE type, but B.col2 is of BIGINT,  will print WARNING: Comparing a bigint and a double may result in a loss of precision.  Why can't cast col2 to double automatically?

站在用戶的角度思考問(wèn)題,與客戶深入溝通,找到津市網(wǎng)站設(shè)計(jì)與津市網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、國(guó)際域名空間、虛擬空間、企業(yè)郵箱。業(yè)務(wù)覆蓋津市地區(qū)。

> If A.col1 is of DOUBLE type,

> but B.col2 is of BIGINT,

The automatic conversion is not acceptable according to the java language

spec (section 5.1.2)

https://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.1.2

Also to be noted here is that in general, that even if you cast, you might

be casting the wrong way around.

Because joins on double columns will give incorrect (rather unintended,

but IEEE 754 correct) results when comparing byte serialized

representations - because of the nearly-equal property epsilon.

Easiest way to demonstrate this is to try the simplest off-by-epsilon case

(say, in python)

>>> import sys

>>> 0.1 + 0.2

0.30000000000000004

>>> 0.1 + 0.2 > 0.3

True

>>>

>>> ((0.1+0.2) - 0.3) < sys.float_info.epsilon

True

So if the RHS produced ETL values by sum() and the LHS was produced by

parsing log text, the JOIN will output zero rows.

If you want to do equijoins like that, the only valid case is to cast both

to fixed precision bigints (say, convert all dollars to cents, by *100),

not both to double.

Cheers,

Gopal

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。


當(dāng)前名稱:joinondifferentdatatype-創(chuàng)新互聯(lián)
文章轉(zhuǎn)載:http://weahome.cn/article/gjgpd.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部