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: 2433
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: 10244
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: 6966
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: 10244
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: 6966
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: 6966
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 Group Data based on a key Arun Raj DFSORT/ICETOOL 4 Thu Apr 27, 2017 11:29 pm
No new posts Need Help with : IFTHEN(WHEN=GROUP) Sumanta_89 DFSORT/ICETOOL 1 Wed Apr 19, 2017 5:23 pm
No new posts Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am
No new posts Why TS/OP would Not contact site supp... RahulG31 All Other Mainframe Topics 4 Wed Mar 22, 2017 7:46 am
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


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