Wednesday, March 7, 2012

How do I find data having max length in the Database

How do I find data having max length in the Database ?

For example you have the following table:

test (id int, name varchar(20), size int)

If you want to find out the row with max size value, you can query like this:

select top 1 * from test order by size desc

No comments:

Post a Comment