Jump to content

Group By Use Chesi Elaaa


Recommended Posts

Posted

[quote name='chandrabhai6' timestamp='1343253202' post='1302200304']
Wrong
[/quote]
agree..

athanidhi indaka version correst....

  • Replies 68
  • Created
  • Last Reply

Top Posters In This Topic

  • qwerty1204

    16

  • chandrabhai6

    10

  • ChampakDas

    8

  • kiss4amiss

    6

Top Posters In This Topic

Posted

[quote name='arey ooo samba' timestamp='1343253273' post='1302200317']


basically in my col3 I need to know how many times the value of col2 is repeated in the entire table baa
[/quote]

Try the one I gave and lemme know

Posted

[quote name='arey ooo samba' timestamp='1343253273' post='1302200317']

basically in my col3 I need to know how many times the value of col2 is repeated in the entire table baa
[/quote]
do you want to show col1 too??

Posted

naaku ippati varaku col3 endo ardham kaledhu. what exactly u mean by [color=#282828][font=helvetica, arial, sans-serif]aggregation of col2???[/font][/color]

Posted

babu idi t-sql leka oracle aa...... aa code chustey oracle ani na doubt..... plz clarify.....

Posted

[quote name='chandrabhai6' timestamp='1343252895' post='1302200258']
Select
col1 ,
col2,
(select count(1) from tableX A where A.col2=B.col2 group by col2)
From TableX B
[/quote]

rendu tables levu baa..okatee ga undi

TableX A and TableX B enti

Posted

[quote name='Vaampire' timestamp='1343253394' post='1302200340']
naaku ippati varaku col3 endo ardham kaledhu. what exactly u mean by [color=#282828][font=helvetica, arial, sans-serif]aggregation of col2???[/font][/color]
[/quote]
no. of repetitions ani dhaani meaning, i guess

Posted

[quote name='arey ooo samba' timestamp='1343253430' post='1302200345']

rendu tables levu baa..okatee ga undi

TableX A and TableX B enti
[/quote]
nenu ichina SQL oka sari try chey baa, work avvudhi ani anukuntunna

Posted

[quote name='arey ooo samba' timestamp='1343253430' post='1302200345']

rendu tables levu baa..okatee ga undi

TableX A and TableX B enti
[/quote]

same table e..

A and B rename chesadu...

Posted

[quote name='jaffanajeffada' timestamp='1343253011' post='1302200273']
ila try chey, not sure


select distinct a.col1, a.col2, b.col3 from table1 a,
(select col2, count(*) as col3 from table1
group by col2) b
where a.col2= b.col2
[/quote]
This one is correct .

Posted

select TABLEA.col1,TABa.col2,col3 from TABa
inner join (select col2, count(col2) as col3 from TABa group by col2)temp
on temp.col2=TABLEA.col2

Posted

[quote name='jaffanajeffada' timestamp='1343253335' post='1302200333']
do you want to show col1 too??
[/quote]

yes..I need col1 also baa


[quote name='Vaampire' timestamp='1343253394' post='1302200340']
naaku ippati varaku col3 endo ardham kaledhu. what exactly u mean by [color=#282828][font=helvetica, arial, sans-serif]aggregation of col2???[/font][/color]
[/quote]

col2 aggregation ante...col2 lo "abc" 2 times repeat ayyindi kada baa entire table loo...so col3 lo value 2 ani ravali for row1 and row3 but for row2 lo "xyz" ani oka sare undi kada overall table loo andhukee col3 lo dani value 1 ani ravali[quote name='ghazni' timestamp='1343253408' post='1302200342']
babu idi t-sql leka oracle aa...... aa code chustey oracle ani na doubt..... plz clarify.....
[/quote]

I am dng it in DB2 baa

Posted

[quote name='arey ooo samba' timestamp='1343253591' post='1302200372']
yes..I need col1 also baa




col2 aggregation ante...col2 lo "abc" 2 times repeat ayyindi kada baa entire table loo...so col3 lo value 2 ani ravali for row1 and row3 but for row2 lo "xyz" ani oka sare undi kada overall table loo andhukee col3 lo dani value 1 ani ravali

I am dng it in DB2 baa
[/quote]
try like this
[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]select distinct a.col1, a.col2, b.col3 from table1 a,[/background][/size][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)](select col2, count(*) as col3 from table1[/background][/size][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]group by col2) b[/background][/size][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]where a.col2= b.col2[/background][/size][/font][/color]

Posted

[quote name='arey ooo samba' timestamp='1343253591' post='1302200372']

I am dng it in DB2 baa
[/quote]
ohh avna ......

Posted

[quote name='arey ooo samba' timestamp='1343253430' post='1302200345']


rendu tables levu baa..okatee ga undi

TableX A and TableX B enti
[/quote]

Alias bayya same table name meeda 2 aliases

Try Chey working


[img]http://www.gifsoup.com/view1/1444039/brahmi-hug-o.gif[/img]

×
×
  • Create New...