Jump to content

Sql........


ilovekajal

Recommended Posts

[quote name='Sir' timestamp='1341415483' post='1302078683']
Try these queries... edho okati pani chesthundi anukunta...


select sum(replace(trx_qty,',')) from dw_stg_imrt.dlz_wksp_bph_d
select sum(replace(trx_qty,',','')) from dw_stg_imrt.dlz_wksp_bph_d
select sum(trim(replace(trx_qty,',',' '))) from dw_stg_imrt.dlz_wksp_bph_d
select sum(to_number(trim(replace(trx_qty,',',' ')))) from dw_stg_imrt.dlz_wksp_bph_d
[/quote]


gp

Link to comment
Share on other sites

[quote name='IdriveNinja' timestamp='1341415649' post='1302078692']
Try this

Select sum(Yourcolumnname) from (select cast(replace(Yourcolumnname, ',', '') as number) from YourTablename);
[/quote]

bhayya idhi work avvadam ledhu bhayya

Link to comment
Share on other sites

[quote name='Sir' timestamp='1341415904' post='1302078703']
Naaku oracle raadhu baa... t-sql light ga vachu,... andhuke naalugu queries icchi edho okati work avuthundi try cheyyamanna... 2nd di work ayindanta...
[/quote]

Ikkada no difference between any databases... last two queries lo you are replacing it with space value kadha... Ye database aina adhi string lagane consider cesthadhi...But I didnt see you didn't have space in the replaced value...Anyways we learned something new today, thats all matters.

Link to comment
Share on other sites

[quote name='IdriveNinja' timestamp='1341416073' post='1302078708']

Ikkada no difference between any databases... last two queries lo you are replacing it with space value kadha... Ye database aina adhi string lagane consider cesthadhi...But I didnt see you didn't have space in the replaced value...Anyways we learned something new today, thats all matters.
[/quote]
space tho replace chesaka trim vaadaanu ga...

Link to comment
Share on other sites

[quote name='Sir' timestamp='1341415483' post='1302078683']
Try these queries... edho okati pani chesthundi anukunta...


select sum(replace(trx_qty,',')) from dw_stg_imrt.dlz_wksp_bph_d
select sum(replace(trx_qty,',','')) from dw_stg_imrt.dlz_wksp_bph_d
select sum(trim(replace(trx_qty,',',' '))) from dw_stg_imrt.dlz_wksp_bph_d
select sum(to_number(trim(replace(trx_qty,',',' ')))) from dw_stg_imrt.dlz_wksp_bph_d
[/quote]

sHa_clap4 sHa_clap4 sHa_clap4

Link to comment
Share on other sites

check if [color=#282828][font=helvetica, arial, sans-serif]TRX_QTY has any null values or blank/ '' . if so, replace them with zero[/font][/color]

Link to comment
Share on other sites

×
×
  • Create New...