Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-01-2007, 05:22 PM   PM User | #1
oskare100
New Coder

 
Join Date: Dec 2006
Posts: 57
Thanks: 2
Thanked 0 Times in 0 Posts
oskare100 is an unknown quantity at this point
Select all rows where the dec row contains or ends with 0.

Hello,
I need to select all rows * from a MySQL database where the dec column ends with 0 (or contains 0 if it is easier). How can I do that?

Best Regards
oskare100 is offline   Reply With Quote
Old 02-01-2007, 06:09 PM   PM User | #2
neomaximus2k
Regular Coder

 
Join Date: Jan 2007
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
neomaximus2k is an unknown quantity at this point
ok this one is fairly simple you would do something like this

Code:
SELECT * FROM table WHERE `dec` LIKE '%0'
If you wanted to check that the field had a 0 in there no matter where it is then you can do

Code:
SELECT * FROM table WHERE `dec` LIKE '%0%'
The %'s act as wildcards so doing %0 means that the last character must be 0 and doing %0% means that the cheracter 0 can be anywhere in that field.

If you need any further information let me know
__________________
Matthew Bagley
Paramiliar Design Studios
Website Design | Website Development | Search Engine Optimisation (SEO)
neomaximus2k is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:37 AM.


Advertisement
Log in to turn off these ads.