db2 語法一問
求救一下要如何才能顯示正常數字,而不是科學數字呢?
Warning: odbc_result(): Field index is larger than the number of fields in /www/aix_vg.php on line 29
A3SAC001
tptvg02
3.20000000000000E+001
1.42800000000000E+003
Warning: odbc_result(): Field index is larger than the number of fields in /www/aix_vg.php on line 29
A3SAC001
tptvg01
3.20000000000000E+001
1.90400000000000E+003
Warning: odbc_result(): Field index is larger than the number of fields in /www/aix_vg.php on line 29
A3SAC001
rootvg
1.28000000000000E+002
1.09200000000000E+003
SELECT VG_NAME,
VG_PP AS MBYTES,
(VG_TPPS*VG_PP) AS TOTAL_MBYTES,
(VG_FPPS*VG_PP) AS FREE_MBYTES,
(VG_UPPS*VG_PP) AS USED_MBYTES
FROM SA.AIX_VG
WHERE HOST='A3SAC001'";
host vg vg_pp VG_TPPS VG_FPPS VG_UPPS
'A3SAC001' 'tptvg02' 32 1428 40 1388
'A3SAC001' 'tptvg01' 32 1904 1308 596
'A3SAC001' 'rootvg' 128 1092 674 418
Warning: odbc_result(): Field index is larger than the number of fields in /www/aix_vg.php on line 29
A3SAC001
tptvg02
3.20000000000000E+001
1.42800000000000E+003
Warning: odbc_result(): Field index is larger than the number of fields in /www/aix_vg.php on line 29
A3SAC001
tptvg01
3.20000000000000E+001
1.90400000000000E+003
Warning: odbc_result(): Field index is larger than the number of fields in /www/aix_vg.php on line 29
A3SAC001
rootvg
1.28000000000000E+002
1.09200000000000E+003
SELECT VG_NAME,
VG_PP AS MBYTES,
(VG_TPPS*VG_PP) AS TOTAL_MBYTES,
(VG_FPPS*VG_PP) AS FREE_MBYTES,
(VG_UPPS*VG_PP) AS USED_MBYTES
FROM SA.AIX_VG
WHERE HOST='A3SAC001'";
host vg vg_pp VG_TPPS VG_FPPS VG_UPPS
'A3SAC001' 'tptvg02' 32 1428 40 1388
'A3SAC001' 'tptvg01' 32 1904 1308 596
'A3SAC001' 'rootvg' 128 1092 674 418
作者: 68930089 发布时间: 2011-01-25
回复 68930089
如果确定没有小数,可以用int()或bigint()函数转换一下,或干脆就把字段类型改掉(感觉你定义的是double型),否则用decimal()函数,但是长度你要考虑好。
如果确定没有小数,可以用int()或bigint()函数转换一下,或干脆就把字段类型改掉(感觉你定义的是double型),否则用decimal()函数,但是长度你要考虑好。
作者: 3sane 发布时间: 2011-01-27