Getting data with minimum lenght

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
wizzard81
Forum Commoner
Posts: 66
Joined: Wed Jan 15, 2003 6:05 am
Location: Belgium
Contact:

Getting data with minimum lenght

Post by wizzard81 »

Hi,

I have a database with a table with 10000 links but i want to grab out 200 links with a minimum description lenght is this possible via mysql?

Cheers
Kris
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Code: Select all

SELECT `column1` FROM `table` WHERE CHAR_LENGTH(`column2`) > 20
untested.
wizzard81
Forum Commoner
Posts: 66
Joined: Wed Jan 15, 2003 6:05 am
Location: Belgium
Contact:

Post by wizzard81 »

its not working
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

With MySQL it's possible as following:

Code: Select all

SELECT whatever
FROM table
ORDER BY CHAR_LENGTH('description') ASC
LIMIT 0, 200
Post Reply