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: 2422
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: 10202
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: 10202
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: 1278
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: 1278
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: 1278
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 Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am


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