473,385 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

max(char10) is giving wrong data where column has alphanumeric data

Hi,

I have a table with column char(20). The table has alphanumeric data. When i select max(column) on that table, its giving wrong data. See below more details:

Data:
db2 "select * from EPSAR_WKLY_DET_UV"
R33337A00A3E
R33337883E70

select max(RETAIN_USER_ID) from EPSAR_WKLY_DET_UV" =
R33337A00A3E

Instead of R33337883E70 which is bigger, its displaying
R33337A00A3E.
DB cfg parameters:

Database code page= 1208
Database code set = UTF-8
Database collating sequence= IDENTITY

Can anyone help with how to fix this issue.

Regards,
Ramz.
Jan 18 '11 #1
3 2165
Rabbit
12,516 Expert Mod 8TB
R33337A00A3E is larger than R33337883E70 because A is larger than 8. All alpha characters are larger than numeric characters. You will have to strip the field of all other characters before doing your max.
Jan 18 '11 #2
When i ran the query against production database, I got R33337883E70 as maximum value and i don't have access to production server to check dd cfg parameters.
What needs to be changed to get the other value as maximum just like production database.

Thanks.
Jan 18 '11 #3
vijay2082
112 100+
Hi,

You are getting correct result as per your settings.Get your DBA into picture and tell him to cross check the things for you. Rather than speculating the things; that can be straight forward way to nail the issue and get the things going.

Cheers, Vijay
Jan 19 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Chris Online | last post by:
Hi all, At the moment I'm using a Altera MAX and MAX+plus2 graphical design software. I'm using the following parts inside the altera: Octal flipflop 74HC273 AddressDecoder 74HC154 Octal Buffer...
9
by: Sean | last post by:
I am using a datagrid to display some data. I notice when I click in a cell where the data is longer than the cell width, it truncates the end of the data off. For example: The data is: This...
1
by: Steve Farmer | last post by:
Hi everybody, I have a column in a DataSet (ItemNo) where I need to find out the highest number, so I can add 1 to it when a new record is written to the database. What is the best way to that...
2
by: Bill Nguyen | last post by:
I need sample code to insert binary file (mappoint map file) into a varbinary column using VB.NET. Please help! Thanks Bill
2
by: brob | last post by:
I am Access newbie looking for some guidance in putting together a query that can output a table of max values in a given column grouped by a couple of other columns. Here is an example of what I...
6
by: mike | last post by:
so I keep optimizing my fields down to the minimum character length necessary i.e., varchar(15), then I find out a month later its gotta get bigger, then a few months later, bigger again, etc. ...
8
by: nico3334 | last post by:
I have a database that has a Date column (1/1/2007) and a Data column that has numerical data. I am currently running a query to sum the Data column for a certain month and grouped by day (There is...
1
by: codekhan | last post by:
Hi, I have a table with about 30 - 40 columns, I am trying to obtain a single value for each column that occurs the most in that column (this includes names as well)
7
by: Brian | last post by:
I'm trying to run a select max() on a primary key/unique/non-identity column then + 1, all while running an insert into.. select statement. For some reason, the select max isn't quite doing the...
1
by: kthorpe | last post by:
I'm working on a timesheet tracking application - each time a person's hours are changed, a new row gets added to the database. The columns are timeid (int primary key), employmentid (int), hours...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.