IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to use GROUP BY clause on VARCHAR variable?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Permander Malik

New User


Joined: 24 Oct 2009
Posts: 11
Location: Mumbai

PostPosted: Fri Dec 11, 2009 3:05 pm
Reply with quote

Hi All,

I want to use GROUP BY clause on VARCHAR variable. Can anyone please let me know how we can use that?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2480
Location: Netherlands, Amstelveen

PostPosted: Fri Dec 11, 2009 3:21 pm
Reply with quote

www.db-staff.com/index.php/microsoft-sql-server/86-sql-group-by
Back to top
View user's profile Send private message
Permander Malik

New User


Joined: 24 Oct 2009
Posts: 11
Location: Mumbai

PostPosted: Fri Dec 11, 2009 5:22 pm
Reply with quote

On the above link I did not find the same. Can anyone help me out.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Fri Dec 11, 2009 5:28 pm
Reply with quote

I do not see any reaso from a conceptual point of view to treat
a varchar column differently from a <normal> column

what did You find to make You believe You need special processing?
Back to top
View user's profile Send private message
Permander Malik

New User


Joined: 24 Oct 2009
Posts: 11
Location: Mumbai

PostPosted: Fri Dec 11, 2009 5:31 pm
Reply with quote

Its not returning any result for me in DB2 query. Any idea how we can get through ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Dec 11, 2009 5:35 pm
Reply with quote

your second where clause condition is causing the no-result condition
Back to top
View user's profile Send private message
bhairon singh rathore

New User


Joined: 19 Jun 2008
Posts: 91
Location: banglore

PostPosted: Fri Dec 11, 2009 5:41 pm
Reply with quote

Can you provide us with the query which you are working on
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Fri Dec 11, 2009 5:43 pm
Reply with quote

Quote:
Can you provide us with the query which you are working on


why do You insist in trying to make things easy for people willing to help icon_biggrin.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Dec 11, 2009 6:00 pm
Reply with quote

Permander Malik wrote:
Its not returning any result for me in DB2 query.


and you are blaming this on the GROUP BY statement?

you need to correct your WHERE clause.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Dec 11, 2009 7:08 pm
Reply with quote

Funny, I get the same question here from an analist of a project that we outsourced to India.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Dec 11, 2009 7:21 pm
Reply with quote

explaining the problem :
It is not that he is getting sqlcode +100, He's having a time out because of the performance that grouping on a varchar(6000) can cause.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Dec 11, 2009 8:06 pm
Reply with quote

GuyC,

well, how come you guys outsource the easy stuff?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Dec 11, 2009 8:11 pm
Reply with quote

dbzTHEdinosauer wrote:
GuyC,

well, how come you guys outsource the easy stuff?

Well, because we're to busy with the difficult stuff
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Creating CSV file from Variable recs ... DFSORT/ICETOOL 11
No new posts Evaluate variable to execute a jcl step JCL & VSAM 3
No new posts Inserting variable length into output... JCL & VSAM 2
No new posts Setting CA7 user variable from data s... CA Products 7
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
Search our Forums:

Back to Top