Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2006
    Posts
    57
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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

  • #2
    Regular Coder
    Join Date
    Jan 2007
    Posts
    213
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •