Jump to content

Sql Query Help


Recommended Posts

Posted

[quote name='deals2buy' timestamp='1352921512' post='1302796165']
Yes, 2 rows vasthayi since they have phonenumbers and those stuff diff

btw Name, Address raavatam leda?
[/quote]
Ledhu inka try cheyaledhu...but dbt vachindhi rows ela vasthayi ani....:P

  • Replies 66
  • Created
  • Last Reply

Top Posters In This Topic

  • mtkr

    20

  • deals2buy

    17

  • kotha thread

    16

  • athadu

    7

Top Posters In This Topic

Posted

[quote name='SREEE' timestamp='1352923342' post='1302796406']
deeni O/p ela untundhi mama....
[/quote]
[quote name='SREEE' timestamp='1352923393' post='1302796413']
Ledhu inka try cheyaledhu...but dbt vachindhi rows ela vasthayi ani.... :P
[/quote]

nee moham... try cheyyavayya...queries chuste raavu....paina ichina queries anni okasri run chesi chudu..neeke ardhamaipotundi ela cheyyalo? ivem DML commands kaadu ga...just SELECT ey ga..try them

Posted

Do a LEFT OUTER JOIN and TRY USING A COALESCE statemnet on the required column in TABLE C so that, as discussed in the examples above, you can all the phone number in a row with comma separated values

1) JOHN | UNIT 104, NEWYORK, 12345,USA | 123-456-7899,123-456,7888,123-456,7588

"Pipes" columns separate cheyadaniki use chesanu

Posted

[quote name='deals2buy' timestamp='1352923470' post='1302796422']
nee moham... try cheyyavayya...queries chuste raavu....paina ichina queries anni okasri run chesi chudu..neeke ardhamaipotundi ela cheyyalo? ivem DML commands kaadu ga...just SELECT ey ga..try them
[/quote]
chestha mama..ikkada sachinodu data...veyaledhu so andhuke aganu.....:D

Posted

[quote name='athadu' timestamp='1352924557' post='1302796530']
Do a LEFT OUTER JOIN and TRY USING A COALESCE statemnet on the required column in TABLE C so that, as discussed in the examples above, you can all the phone number in a row with comma separated values

1) JOHN | UNIT 104, NEWYORK, 12345,USA | 123-456-7899,123-456,7888,123-456,7588

"Pipes" columns separate cheyadaniki use chesanu
[/quote]
command please,and phnumbers table lo multiple coloumns unttte ela vasthayi mama...Query ikkada veyyi....

Posted

select A.*, b.*, c.*
from tbl_a A
inner join tbl_b B
on A.emp_id = B.emp_id
inner join tbl_c C
on B.primary_key = C.foreign_key

Posted

[quote name='athadu' timestamp='1352924557' post='1302796530']
Do a LEFT OUTER JOIN and TRY USING A COALESCE statemnet on the required column in TABLE C so that, as discussed in the examples above, you can all the phone number in a row with comma separated values

1) JOHN | UNIT 104, NEWYORK, 12345,USA | 123-456-7899,123-456,7888,123-456,7588

"Pipes" columns separate cheyadaniki use chesanu
[/quote]

()>>
[quote name='SREEE' timestamp='1352925649' post='1302796704']
chestha mama..ikkada sachinodu data...veyaledhu so andhuke aganu..... :D
[/quote]

data okadu esudu endi mama? :3D_Smiles: neeku nuvvu load chesukovachu ga?
[quote name='SREEE' timestamp='1352925710' post='1302796714']
command please,and phnumbers table lo multiple coloumns unttte ela vasthayi mama...Query ikkada veyyi....
[/quote]

paina manodu cheppinattu COALESCE statement will combine everything and will get it in once column

Posted

[quote name='athadu' timestamp='1352924557' post='1302796530']
Do a LEFT OUTER JOIN and TRY USING A COALESCE statemnet on the required column in TABLE C so that, as discussed in the examples above, you can all the phone number in a row with comma separated values

1) JOHN | UNIT 104, NEWYORK, 12345,USA | 123-456-7899,123-456,7888,123-456,7588

"Pipes" columns separate cheyadaniki use chesanu
[/quote]
[quote name='deals2buy' timestamp='1352926630' post='1302796855']

paina manodu cheppinattu COALESCE statement will combine everything and will get it in once column
[/quote]

coalesce returns frst non-null value kadaa!!!!! adi rows ni ela combine chesthadiii(am nt sure)
n manodiki for every multiple ph num it needs 2 should show up as separate row.....

Posted

[quote name='mtkr' timestamp='1352926549' post='1302796840'] select A.*, b.*, c.* from tbl_a A inner join tbl_b B on A.emp_id = B.emp_id inner join tbl_c C on B.primary_key = C.foreign_key [/quote] [quote name='deals2buy' timestamp='1352926630' post='1302796855'] ()>> data okadu esudu endi mama? :3D_Smiles: neeku nuvvu load chesukovachu ga? paina manodu cheppinattu COALESCE statement will combine everything and will get it in once column [/quote]


nenu join ayyi 1 week avuthundhi mama...naku read only access undhi...dev DB mirror ki...and am a java Devloper...so..nene veyanu data vadu vesthe nenu theestha :P....oke function chusa...infrmative....adhi try chestha...inka......tyyy

Posted

[quote name='mtkr' timestamp='1352926841' post='1302796904']
coalesce returns frst non-null value kadaa!!!!! adi rows ni ela combine chesthadiii(am nt sure)
n manodiki for every multiple ph num it needs 2 should show up as separate row.....
[/quote]

emo antha idea ledu mama.. last time naaku evaro raasi pettaru query nenu vaadesukunna :P
[quote name='SREEE' timestamp='1352926871' post='1302796911']
nenu join ayyi 1 week avuthundhi mama...naku read only access undhi...dev DB mirror ki...and am a java Devloper...so..nene veyanu data vadu vesthe nenu theestha :P....oke function chusa...infrmative....adhi try chestha...inka......tyyy
[/quote]

vaarini Java developer aithe mari SQL Server tho panendi?

Posted

[quote name='deals2buy' timestamp='1352926989' post='1302796934']
emo antha idea ledu mama.. last time naaku evaro raasi pettaru query nenu vaadesukunna :P


vaarini Java developer aithe mari SQL Server tho panendi?
[/quote]
:3D_Smiles_216: :3D_Smiles_216: em cheppali mama..kanisam appln ardham kuda kaledhu oka flow motham rayamnnadu..daridhrudu....G D koni....programme raasi....ippudu query meedha padda...ayithe manaku antha touch ledhu..and ippudu chadhivi rase antha opika ledhu mama....so..ila thread vesa......joke entantte...naaku inka lappy kuda ivvaledhu...evado system meedha cheymantunnaru..... :#<

Posted

[quote name='SREEE' timestamp='1352927363' post='1302796995']
:3D_Smiles_216: :3D_Smiles_216: em cheppali mama..kanisam appln ardham kuda kaledhu oka flow motham rayamnnadu..daridhrudu....G D koni....programme raasi....ippudu query meedha padda...ayithe manaku antha touch ledhu..and ippudu chadhivi rase antha opika ledhu mama....so..ila thread vesa.....[b][color=#ff0000].joke entantte...naaku inka lappy kuda ivvaledhu...evado system meedha cheymantunnaru.....[/color][/b] :#<
[/quote]
[img]http://www.manadb.com/Smileys/default/Brahmi.gif[/img]

Posted

this might help..

[b]try doing this..[/b]

[b]declare @empphonenumber varchar(100)[/b]

[b]select A.Column A, B.Column B, @[b]empphonenumber [/b]= coalesce(@[b]empphonenumber [/b]+',','')+ C.employeephonenumber[/b]
[b]FROM table a inner join table B [/b]
[b]ON a.xxxx=b.xxxx[/b]
[b]LEFT OUTERJOIN TABLE C[/b]
[b]ON b.wtever =c.wtever[/b]

[b]similar ga untndi query try it out, also, nenu anukunadi..you wanted everyhting in a row insetad of multiple rows for every phone number.. ?? is that right??[/b]

Posted

[quote name='mtkr' timestamp='1352926549' post='1302796840']
select A.*, b.*, c.*
from tbl_a A
inner join tbl_b B
on A.emp_id = B.emp_id
inner join tbl_c C
on B.primary_key = C.foreign_key
[/quote]

[size=6]select A.id, B.*,COALESCE(C.*) from tbl_a A RIGHTOUTERJOIN tbl_b B [/size]
[size=6]on A.emp_id = B.emp_id[/size]
[size=6]RIGHTOUTERJOIN tbl_c C[/size]
[size=6]on B.primary_key = C.foreign_key ;[/size]


[size=6]ila anukuntunna mama....wrk avudha.... sCo_^Y sCo_^Y sCo_^Y ..[/size]


[size=6]SO NAAKU B table and C table data vasthundhi.....?[/size]

×
×
  • Create New...