Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search for column that contains more than 20 characters 1

Status
Not open for further replies.

biglebowski

Technical User
Jan 29, 2004
3,117
0
36
GB
We are having issues where transaction numbers are being inserted into the DB with more than the specified number of characters.

They should go into a column called transaction so what i want to search for is something like:

select * from Packages where Transaction contains more than 20 characters

weight.png
 
Code:
select * from Packages where char_length(Transaction) > 20
On older versions of MySQL you might need to use length() instead of char_length() (the two functions are equivalent anyway if you don't need to deal with multi-byte characters)

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top