Hi,
Can we use MAX on a CHAR column?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 30, 2011, 11:09 PM EST
char is fixed length datatype which is limited to 8,000 characters in size.
Priya LingeRank #785 · 2.9K reputationPosted Nov 30, 2011, 11:11 PM EST
Yes ,we can use max on char.
Example >
CREATE TABLE test ( id char(15), name
char(80) )
INSERT INTO test VALUES ( '10', 'luidgi');
INSERT INTO test VALUES ( '20', 'luis');
select * from test
SELECT max(id) FROM test
OutPut : 1 20
Hope this will help you.
Thanks.
VulpesRank #55 · 29.2K reputationPosted Nov 30, 2011, 11:13 PM EST
See link below for confirmation:
http://msdn.microsoft.com/en-us/library/ms187751.aspx
Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 30, 2011, 11:27 PM EST
its about function.
Akash AhlawatRank #3,915 · 379 reputationPosted Dec 1, 2011, 2:19 AM EST
Anuja PawarRank #1,404 · 1.2K reputationPosted Dec 1, 2011, 4:33 AM EST
where adtAddressTypeID is char(15) and it works fine
So max works fine with char type
Akash AhlawatRank #3,915 · 379 reputationPosted Dec 1, 2011, 11:51 PM EST
Thanks guys