Calling all oracle pl/sql experts Chalanachithram.com | Topics | Search
Hide Clipart | Log Out | Register | Edit Profile

Last 30 mins | 1 | 2 | 4 hours     Last 1 | 7 Days

Chalanachithram.com DB » New TF Industry Related » Archive through November 21, 2013 » Calling all oracle pl/sql experts « Previous Next »

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

Saint
Megastar
Username: Saint

Post Number: 24696
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 04:04 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Sachin:


why is it working? in the other case why is it not working?
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 24690
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 03:29 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Gandhiguevara:


eti gagu wats happening?
Top of pagePrevious messageNext messageBottom of page Link to this message

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 42383
Registered: 10-2009
Posted From: 142.136.137.10

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 03:05 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:


Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 24689
Registered: 01-2011
Posted From: 68.13.100.193

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 02:45 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

Sachin,

Yes its working..

Inko catch emiti ante substr expr teseai just column name itchina .. Its working...

So diff ento jeppale
Top of pagePrevious messageNext messageBottom of page Link to this message

Botsa_fan
Junior Artist
Username: Botsa_fan

Post Number: 178
Registered: 07-2013
Posted From: 158.48.133.2

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 02:42 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:

|| '","' || concatenate chesi single column lekka jesthundi




Saint:

C/C++ developer oracle pl/sql developer ithe inthe vuntada?



kiki ..ilage..as it is ga vuntadhi.
Top of pagePrevious messageNext messageBottom of page Link to this message

Sachin
Legend
Username: Sachin

Post Number: 35946
Registered: 04-2008
Posted From: 151.151.109.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 02:03 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:

vaakey...got it...

|| '","' || concatenate chesi single column lekka jesthundi ....so adi teesesthe work out ayyidi....may be grp by lo kooda concatenate jesi same to same ettali emo..




mari 2 sqls working annaaav
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 24686
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 01:36 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

vaakey...got it...

|| '","' || concatenate chesi single column lekka jesthundi ....so adi teesesthe work out ayyidi....may be grp by lo kooda concatenate jesi same to same ettali emo...
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 24684
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 01:30 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

select b.1 || '","' ||
NVL(SUBSTR(a.1,1,6)||
REGEXP_REPLACE(SUBSTR(a.1,7,LENGTH(a.1)-10),'[0123456789]',' X')||
SUBSTR(a.1,LENGTH(a.1)-3,4),
SUBSTR(a.2,1,6)||
REGEXP_REPLACE(SUBSTR(a.2,7,LENGTH(a.2)-10),'[0123456789]',' X')||
SUBSTR(a.2,LENGTH(a.2)-3,4)) || '","' ||
count( a.3)||'"'
from a, b
where b.3=a.4
group by
NVL(SUBSTR(a.1,1,6)||
REGEXP_REPLACE(SUBSTR(a.1,7,LENGTH(a.1)-10),'[0123456789]',' X')||
SUBSTR(a.1,LENGTH(a.1)-3,4),
SUBSTR(a.2,1,6)||
REGEXP_REPLACE(SUBSTR(a.2,7,LENGTH(a.2)-10),'[0123456789]',' X')||
SUBSTR(a.2,LENGTH(a.2)-3,4)), b.1

union
select b.1 || '","' ||
NVL(SUBSTR(a.1,1,6)||
REGEXP_REPLACE(SUBSTR(a.1,7,LENGTH(a.1)-10),'[0123456789]',' X')||
SUBSTR(a.1,LENGTH(a.1)-3,4),
SUBSTR(a.2,1,6)||
REGEXP_REPLACE(SUBSTR(a.2,7,LENGTH(a.2)-10),'[0123456789]',' X')||
SUBSTR(a.2,LENGTH(a.2)-3,4)) || '","' ||
count( a.3)||'"'
from a, b where a.3=745747 and b.3=a.4
group by
NVL(SUBSTR(a.1,1,6)||
REGEXP_REPLACE(SUBSTR(a.1,7,LENGTH(a.1)-10),'[0123456789]',' X')||
SUBSTR(a.1,LENGTH(a.1)-3,4),
SUBSTR(a.2,1,6)||
REGEXP_REPLACE(SUBSTR(a.2,7,LENGTH(a.2)-10),'[0123456789]',' X')||
SUBSTR(a.2,LENGTH(a.2)-3,4)), b.1
Top of pagePrevious messageNext messageBottom of page Link to this message

Sachin
Legend
Username: Sachin

Post Number: 35944
Registered: 04-2008
Posted From: 151.151.109.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 01:06 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

sql paste cheyyi doraaaa...change table and column names...
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 24676
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 01:00 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

C/C++ developer oracle pl/sql developer ithe inthe vuntada?

maa DBA jump ante ...naaku koddiga vachu anu work antha teesukunna....expectations peddaga levu but I am enjoying this new work...

oka side JPA/eclipselink..inko side pl/sql dev....

hire chesina skill set C/C++ dev ....c/C++ meeda work chesi almost 2 months paine avuthundi ... ki ki ki....
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 24674
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:56 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Casino:

The presence of a group by clause introduces certain restrictions with regards to the fields that can be referenced in the select list. In particular, a field or expression that does not appear in the group by clause cannot appear in the select list, unless it is used in an aggregate function call.




yes..its taken care...all select list was present in group by except the aggregate fn call one..
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 24673
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:55 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Andhrawala:


with Union u cant do Group by




u can..we were doing it since long time..
Top of pagePrevious messageNext messageBottom of page Link to this message

Casino
Side Hero
Username: Casino

Post Number: 3047
Registered: 01-2012
Posted From: 198.46.98.226

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:50 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Andhrawala:



with Union u cant do Group by


kaadhu anukunta, atleast in ANSI SQL
Top of pagePrevious messageNext messageBottom of page Link to this message

Casino
Side Hero
Username: Casino

Post Number: 3046
Registered: 01-2012
Posted From: 198.46.98.226

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:49 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:

if I remove the expression and just put the column, that is also giving error...


The presence of a group by clause introduces certain restrictions with regards to the fields that can be referenced in the select list. In particular, a field or expression that does not appear in the group by clause cannot appear in the select list, unless it is used in an aggregate function call.

** See where it says expression **
Top of pagePrevious messageNext messageBottom of page Link to this message

Andhrawala
Megastar
Username: Andhrawala

Post Number: 26644
Registered: 03-2008
Posted From: 152.51.56.1

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:46 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Casino:

can't you do group by in individual queries in Oracle?




with Union u cant do Group by
No Signature
Top of pagePrevious messageNext messageBottom of page Link to this message

Dreamcatcher
Side Hero
Username: Dreamcatcher

Post Number: 4886
Registered: 11-2009
Posted From: 208.86.145.68

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:40 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Casino:




Botsa_fan:




Twitter:




you are right, my bad..somehow I thought there was a restriction like that. come to think of it, it should work.
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 24672
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:40 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Twitter:


i think saint kurrod group by actual column badhulu aliased column vaduthunnadu..




actual column name yee vaduthunna....the entire expression was copied to group by...(expression in select qry)

if I remove the expression and just put the column, that is also giving error...
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 24671
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:38 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

each qry has grp by before union. it was working fine...
now I modified one column to mask the values. the same is copied into group by ...
Top of pagePrevious messageNext messageBottom of page Link to this message

Twitter
Legend
Username: Twitter

Post Number: 31043
Registered: 10-2009
Posted From: 192.193.171.149

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:38 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

group by in both sqls works in union anukunta ..

i think saint kurrod group by actual column badhulu aliased column vaduthunnadu..
Top of pagePrevious messageNext messageBottom of page Link to this message

Botsa_fan
Junior Artist
Username: Botsa_fan

Post Number: 177
Registered: 07-2013
Posted From: 158.48.133.2

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:36 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Casino:

select object_id, name from sys.columns group by object_id, name
union
select object_id, name from sys.columns group by object_id, name



you can do the same thing in oracle too
Top of pagePrevious messageNext messageBottom of page Link to this message

Casino
Side Hero
Username: Casino

Post Number: 3045
Registered: 01-2012
Posted From: 198.46.98.226

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:35 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Dreamcatcher:

do you have group by twice, once before union and after union?? that would be not allowed. group by is applied only once for the entire query at the end. so your query should be

select X,Y,Z from a,b,c,d where codnitions union
select x,y,z from a,b,c,d where diff condtions
group by x,y,z


agree with you on logically, however I don't think there should be any restriction like that...

as an example, this is the query I just ran in sql server and it works like a charm...

select object_id, name from sys.columns group by object_id, name
union
select object_id, name from sys.columns group by object_id, name
Top of pagePrevious messageNext messageBottom of page Link to this message

Botsa_fan
Junior Artist
Username: Botsa_fan

Post Number: 176
Registered: 07-2013
Posted From: 158.48.133.2

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:34 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:


nuvvu substr chesey column included in group by
Top of pagePrevious messageNext messageBottom of page Link to this message

Casino
Side Hero
Username: Casino

Post Number: 3044
Registered: 01-2012
Posted From: 198.46.98.226

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:32 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Andhrawala:

select x,y,z from
(
select X,Y,Z from a,b,c,d where codnitions
union
union
select x,y,z from a,b,c,d where diff condtions)
group by x,y,z


can't you do group by in individual queries in Oracle?
Top of pagePrevious messageNext messageBottom of page Link to this message

Dreamcatcher
Side Hero
Username: Dreamcatcher

Post Number: 4885
Registered: 11-2009
Posted From: 208.86.145.68

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:31 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

do you have group by twice, once before union and after union?? that would be not allowed. group by is applied only once for the entire query at the end. so your query should be

select X,Y,Z from a,b,c,d where codnitions union
select x,y,z from a,b,c,d where diff condtions
group by x,y,z
Top of pagePrevious messageNext messageBottom of page Link to this message

Andhrawala
Megastar
Username: Andhrawala

Post Number: 26642
Registered: 03-2008
Posted From: 152.51.56.1

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:30 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

select x,y,z from
(
select X,Y,Z from a,b,c,d where codnitions
union
union
select x,y,z from a,b,c,d where diff condtions)
group by x,y,z
No Signature
Top of pagePrevious messageNext messageBottom of page Link to this message

Casino
Side Hero
Username: Casino

Post Number: 3043
Registered: 01-2012
Posted From: 198.46.98.226

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:28 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:



Union mundu query / union tarvatha qry invidiual ra run chesthe ..I am getting o/p...union add chesthe pelathandi..


just see how many columns are in the output after you run each query.. # of columns mismatch or column types mismatch.
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 24670
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:26 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Casino:

full query paste cheyyi.. probably some syntax error




Union mundu query / union tarvatha qry invidiual ra run chesthe ..I am getting o/p...union add chesthe pelathandi..
Top of pagePrevious messageNext messageBottom of page Link to this message

Twitter
Legend
Username: Twitter

Post Number: 31041
Registered: 10-2009
Posted From: 192.193.171.149

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:25 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

group by aliases pedithe theesesi original column name pettu work auddhi
Top of pagePrevious messageNext messageBottom of page Link to this message

Casino
Side Hero
Username: Casino

Post Number: 3042
Registered: 01-2012
Posted From: 198.46.98.226

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:23 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

full query paste cheyyi.. probably some syntax error
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 24668
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, November 21, 2013 - 12:17 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

nenu oka pl/sql prog change chesanu....1 clm has to be masked so used substr..etc to replace part of the string with ZZZZZZZ...

execute chesetappudu...

select X,Y,Z from a,b,c,d where codnitions group by x,y,z union
select x,y,z from a,b,c,d where diff condtions group by x,y,z ante

ORA-00979: not a GROUP BY expression
00979. 00000 - "not a GROUP BY expression"
ee error vasthundi...

ade union mundu qry ni ..union tarvtha qry ni individual ga run chese ..o/p is good...union is causing some error...emitoo idea vunda?

Add Your Message Here
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image HASH(0x895a424){Movie Clipart}
Show / hide regular icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

 N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Show / Hide Filmy icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

 N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: