SQL Doubt   Independent houses near kukatpally | Apartments in Pragathi Nagar | AndhraVaani.com | Log Out | Topics | Search
Register | Edit Profile

Bewarse Talk � Archives � Cine Talk - Reviews, Gossips, Insider Info etc. � Archive through April 26, 2006 � SQL Doubt � Previous Next �

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Bob
Vooriki Bewarse
Username: Bob

Post Number: 3059
Registered: 03-2005
Posted From: 64.126.29.9
Posted on Friday, April 21, 2006 - 5:34 pm:   Edit PostDelete PostView Post/Check IP


VEERABHADRA
Top of pagePrevious messageNext messageBottom of page Link to this message

Nayakudu
Vooriki Bewarse
Username: Nayakudu

Post Number: 2883
Registered: 05-2005
Posted From: 129.188.33.222
Posted on Friday, April 21, 2006 - 12:38 pm:   Edit PostDelete PostView Post/Check IP

nenu aa additiona chudaledu mama

ounu UNION ne correct ga work ayyiddi
Top of pagePrevious messageNext messageBottom of page Link to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 19325
Registered: 07-2004
Posted From: 71.234.232.47
Posted on Friday, April 21, 2006 - 12:30 pm:   Edit PostDelete PostView Post/Check IP

nee yenks..kaasepu tension pettavgaa...ponile union e correct annamaata..
Top of pagePrevious messageNext messageBottom of page Link to this message

Nayakudu
Vooriki Bewarse
Username: Nayakudu

Post Number: 2881
Registered: 05-2005
Posted From: 136.182.2.222
Posted on Friday, April 21, 2006 - 12:07 pm:   Edit PostDelete PostView Post/Check IP

enjoy correct ne
Top of pagePrevious messageNext messageBottom of page Link to this message

Nayakudu
Vooriki Bewarse
Username: Nayakudu

Post Number: 2880
Registered: 05-2005
Posted From: 136.182.2.222
Posted on Friday, April 21, 2006 - 12:07 pm:   Edit PostDelete PostView Post/Check IP

ohh correct ne mama

UNION ne correct neeku andukante...
AA nunchi BB nunchi add chesthunnavu ga query lo..

so neeku UNION ne correct
Top of pagePrevious messageNext messageBottom of page Link to this message

Nayakudu
Vooriki Bewarse
Username: Nayakudu

Post Number: 2879
Registered: 05-2005
Posted From: 136.182.2.222
Posted on Friday, April 21, 2006 - 12:02 pm:   Edit PostDelete PostView Post/Check IP

AA
89B Smith 1

BB
89B Smith 1

anuko

AA
UNION
BB

ante result
89B Smith 1

ade

AA
UNION ALL
BB
ante

result 2 rows
89B Smith 1
89B Smith 1
vachhiddi,, inkoka visahayam anni match aithey count add cheyyadu union operator.. neevu count ni rollup chesuko tool lo
Top of pagePrevious messageNext messageBottom of page Link to this message

Nayakudu
Vooriki Bewarse
Username: Nayakudu

Post Number: 2878
Registered: 05-2005
Posted From: 136.182.2.222
Posted on Friday, April 21, 2006 - 12:01 pm:   Edit PostDelete PostView Post/Check IP

UNION use chesthey

first query & second query same row fetch chesthey .. UNION only one row return chesiddi.. appudu neeku SUM thappu vachhiddi...

UNION ALL use chesthey anni rows vasthayi.. so UNION ALL use cheyyuu...
Top of pagePrevious messageNext messageBottom of page Link to this message

Nayakudu
Vooriki Bewarse
Username: Nayakudu

Post Number: 2877
Registered: 05-2005
Posted From: 136.182.2.222
Posted on Friday, April 21, 2006 - 12:00 pm:   Edit PostDelete PostView Post/Check IP

jagrathaga chudu...

ee query ni ekkadaina rasi appudu sum(qty) antunnava tool lo.. appudu tool group by chesiddi
Top of pagePrevious messageNext messageBottom of page Link to this message

Nayakudu
Vooriki Bewarse
Username: Nayakudu

Post Number: 2876
Registered: 05-2005
Posted From: 136.182.2.222
Posted on Friday, April 21, 2006 - 11:59 am:   Edit PostDelete PostView Post/Check IP

mama

sariga work kadu

89B Smith 1

ee case lo neeku output 89B Smith 2 ravali gada

union pedithey only okkate vachhiddi
Top of pagePrevious messageNext messageBottom of page Link to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 19324
Registered: 07-2004
Posted From: 162.136.192.1
Posted on Friday, April 21, 2006 - 11:52 am:   Edit PostDelete PostView Post/Check IP

correctgaane work ayyindhi Nayak maama...nuvvu first cheppindhe correstu...just nenu raasina daani madhyalo union pedithe correctgaa match ayyayi counts and over all data... chass manaki atta union ettalani thelavadhu.. Nayak ki jai

select aa.action,
aa.name,
nvl(aa.count,0) + nvl(bb.count,0)
from aa,bb
where aa.action = bb.action (+)
and aa.name = bb.name(+)

UNION

select bb.action,
bb.name,
nvl(aa.count,0) + nvl(bb.count,0)
from aa,bb
where aa.action(+) = bb.action
and aa.name (+) = bb.name
Top of pagePrevious messageNext messageBottom of page Link to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 19323
Registered: 07-2004
Posted From: 162.136.192.1
Posted on Friday, April 21, 2006 - 11:36 am:   Edit PostDelete PostView Post/Check IP

maama,

oka subquery 'AA' returns these vaues :

Action Name Count
78A Rob 1
68A Rob 1
58A Rob 1
89B Smith 1
75C Smith 1

inko Subquery BB returns these

Action Name Count
78A Rob 1
88A Rob 1
98A Rob 1
89B Smith 1
75C Smith 1
85D Tom 1

Ippudu naaku rendu join chesthey actions anni kaavali...names kooda annai kaavali..okavela action and name rendu match ayithe count add avvali...so output should be

Action Name Count
78A Rob 2
68A Rob 1
58A Rob 1
89B Smith 2
75C Smith 2
88A Rob 1
98A Rob 1
85D Tom 1
Top of pagePrevious messageNext messageBottom of page Link to this message

Nayakudu
Vooriki Bewarse
Username: Nayakudu

Post Number: 2875
Registered: 05-2005
Posted From: 129.188.33.222
Posted on Friday, April 21, 2006 - 11:25 am:   Edit PostDelete PostView Post/Check IP

naku nee rqmt sariga rdham kala..

oka example petti cheppu..
Top of pagePrevious messageNext messageBottom of page Link to this message

Nayakudu
Vooriki Bewarse
Username: Nayakudu

Post Number: 2874
Registered: 05-2005
Posted From: 129.188.33.222
Posted on Friday, April 21, 2006 - 11:25 am:   Edit PostDelete PostView Post/Check IP

counts add kavu mama
Top of pagePrevious messageNext messageBottom of page Link to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 19322
Registered: 07-2004
Posted From: 162.136.192.1
Posted on Friday, April 21, 2006 - 11:24 am:   Edit PostDelete PostView Post/Check IP

maama...itta saasthey automaticgaa action,name match ayyi counts add avuthaaya...


select aa.action,
aa.name,
nvl(aa.count,0)
from aa

union

select bb.action,
bb.name,
nvl(bb.count,0)
from bb
Top of pagePrevious messageNext messageBottom of page Link to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 19321
Registered: 07-2004
Posted From: 162.136.192.1
Posted on Friday, April 21, 2006 - 11:20 am:   Edit PostDelete PostView Post/Check IP

adhi work avvaledhu maama...direct union raayakoodadhemo.... ante nuvvu seppindhi correstey kaani naa requirementski saripodemo
Top of pagePrevious messageNext messageBottom of page Link to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 19320
Registered: 07-2004
Posted From: 162.136.192.1
Posted on Friday, April 21, 2006 - 11:17 am:   Edit PostDelete PostView Post/Check IP

soosaava ninnu testing sesaa...correst answer ichaavu
Top of pagePrevious messageNext messageBottom of page Link to this message

Nayakudu
Vooriki Bewarse
Username: Nayakudu

Post Number: 2873
Registered: 05-2005
Posted From: 129.188.33.222
Posted on Friday, April 21, 2006 - 11:16 am:   Edit PostDelete PostView Post/Check IP

hehehehe
Top of pagePrevious messageNext messageBottom of page Link to this message

Nayakudu
Vooriki Bewarse
Username: Nayakudu

Post Number: 2872
Registered: 05-2005
Posted From: 129.188.33.222
Posted on Friday, April 21, 2006 - 11:16 am:   Edit PostDelete PostView Post/Check IP

select aa.action,
aa.name,
nvl(aa.count,0) + nvl(bb.count,0)
from aa,bb
where aa.action = bb.action (+)
and aa.name = bb.name(+)

UNION

select bb.action,
bb.name,
nvl(aa.count,0) + nvl(bb.count,0)
from aa,bb
where aa.action(+) = bb.action
and aa.name (+) = bb.name
Top of pagePrevious messageNext messageBottom of page Link to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 19318
Registered: 07-2004
Posted From: 162.136.192.1
Posted on Friday, April 21, 2006 - 10:58 am:   Edit PostDelete PostView Post/Check IP

naa kaada rendu peddha subquerylu unnayi...aa,bb

okko subquerylo action,name,count ee moodu data elements theesthunnanu...

naaku renditlo unna data mottham kaavali,counts add cheyyali,aa lo undi bb lo lekapoina bb lo undi aa lo lekapoina kaavali..

select aa.action,
aa.name,
nvl(aa.count,0) + nvl(bb.count,0)
from aa,bb
where aa.action = bb.action (+)
and aa.name = bb.name(+)

ilaa raasthey aa outer join with bb,bb lo unna data aa lo leni data miss avuthondhi...

select bb.action,
bb.name,
nvl(aa.count,0) + nvl(bb.count,0)
from aa,bb
where aa.action(+) = bb.action
and aa.name (+) = bb.name

ilaa raasthey aa lo undi bb lo leni data missing

veetiki union elaa raayali...