Jump to content

Sql........


ilovekajal

Recommended Posts

[quote name='mtkr0' timestamp='1341414481' post='1302078629']
data type varchar lo undhii so anni rec numbers e undakapovochuu...
strings aina undi unatiiii!!!!

chesedhi pl-sql aaa t-sql aaa???

select [color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]TRX_QTY[/background][/size][/font][/color]
from [color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]dw_stg_imrt.dlz_wksp_bph_d[/background][/size][/font][/color]
where like %a%


strings em aina unte telustahi kadaa!!
[/quote]


only sql mama

Link to comment
Share on other sites

[quote name='ilovekajal' timestamp='1341414739' post='1302078639']


yes bhayya konni roes return chesindhi.......6031 rows return chesindhi bhayya........so wat to do next?
[/quote]
Aa return chesi rows lo txt_qty lo em data undhi? emaina non numeric characters unnaya?

veelaithe konni rows ikkada veyyi...

Link to comment
Share on other sites

[quote name='ilovekajal' timestamp='1341414764' post='1302078641']


only sql mama
[/quote]


ne enkammaa...

oracle sql aa microsoft sql a ani adigedhiii!!!


aa functions chusthunte pl-sql e ani telustundhiiii...

Link to comment
Share on other sites

[quote name='ilovekajal' timestamp='1341414739' post='1302078639']


yes bhayya konni roes return chesindhi.......6031 rows return chesindhi bhayya........so wat to do next?
[/quote]
gud on a track now...

a data em ochindiiii???

Link to comment
Share on other sites

[quote name='mtkr0' timestamp='1341414895' post='1302078652']


ne enkammaa...

oracle sql aa microsoft sql a ani adigedhiii!!!


aa functions chusthunte pl-sql e ani telustundhiiii...
[/quote]
Adhi oracle dhi... aa error msg lo ORA ani undi.

And nuv icchina query lo only "a" ane character unte thappa inkem vethakadhu baa... for example data lo 1234b5 ani unte ur query will not find out.

Nenu ippude google lo vethiki oka query patta... to check if any non numeric characters exist ani... chudu oka saari...

Link to comment
Share on other sites

11,970
1,260
1,140
1,890
5,310
11,970


anni ilaney unnayi all are nnumers no decimals or other values

Link to comment
Share on other sites

[quote name='ilovekajal' timestamp='1341415123' post='1302078660']
11,970
1,260
1,140
1,890
5,310
11,970


anni ilaney unnayi all are nnumers no decimals or other values
[/quote]
comma lu unnayi ga... andhuke neeku aa error....

so next step is to replace commas with empty string.... wait, google lo vethiki query pampistha... nuv kuda vethuku...

Link to comment
Share on other sites

[quote name='Sir' timestamp='1341415070' post='1302078657']
Adhi oracle dhi... aa error msg lo ORA ani undi.

And nuv icchina query lo only "a" ane character unte thappa inkem vethakadhu baa... for example data lo 1234b5 ani unte ur query will not find out.

Nenu ippude google lo vethiki oka query patta... to check if any non numeric characters exist ani... chudu oka saari...
[/quote]

ya mama aa functions chusthe telustundhi oracle anii..

emo mama naak oracle anthaga theleyadhuu... anthaga entii assal em theleyadhuuu.....

t-sql aithe kodhoo goppo manage.....

aaa %a% ante atleast eado oka row aina ala undochu thinked anthe.....

  • Upvote 1
Link to comment
Share on other sites

[quote name='Sir' timestamp='1341415274' post='1302078667']
comma lu unnayi ga... andhuke neeku aa error....

so next step is to replace commas with empty string.... wait, google lo vethiki query pampistha... nuv kuda vethuku...
[/quote]
how about stuff n replace??

Link to comment
Share on other sites

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

Link to comment
Share on other sites

[quote name='ilovekajal' timestamp='1341415123' post='1302078660']
11,970
1,260
1,140
1,890
5,310
11,970


anni ilaney unnayi all are nnumers no decimals or other values
[/quote]

Try this

Select sum(Yourcolumnname) from (select cast(replace(Yourcolumnname, ',', '') as number) from YourTablename);

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]

This wont work bro, you are replacing a string value with space which would also be considered as string. Your value would look like below.

11 123
12 23
134 12

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
[b]select sum(replace(trx_qty,',','')) from dw_stg_imrt.dlz_wksp_bph_d[/b]
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]


thank you very much bhayya idhi work avuthundhi............ CITI_y@R CITI_y@R

  • Upvote 1
Link to comment
Share on other sites

import into excel and try sum...
or ..
use functions to change the data type to INTEGER only...not long int or text or anythin

Link to comment
Share on other sites

[quote name='IdriveNinja' timestamp='1341415740' post='1302078696']
This wont work bro, you are replacing a string value with space which would also be considered as string. Your value would look like below.

11 123
12 23
134 12
[/quote]
Naaku oracle raadhu baa... t-sql light ga vachu,... andhuke naalugu queries icchi edho okati work avuthundi try cheyyamanna... 2nd di work ayindanta...

Link to comment
Share on other sites

×
×
  • Create New...