Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to use GROUP BY clause on VARCHAR variable?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: how to use GROUP BY clause on VARCHAR variable?
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: 2434
Location: Netherlands, Amstelveen

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

http://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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10272
Location: italy

PostPosted: Fri Dec 11, 2009 5:28 pm    Post subject: Reply to: how to use GROUP BY clause on VARCHAR variable?
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    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Fri Dec 11, 2009 5:35 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10272
Location: italy

PostPosted: Fri Dec 11, 2009 5:43 pm    Post subject: Reply to: how to use GROUP BY clause on VARCHAR variable?
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: 6967
Location: porcelain throne

PostPosted: Fri Dec 11, 2009 6:00 pm    Post subject:
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    Post subject:
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    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Fri Dec 11, 2009 8:06 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us