TechMynd, Computer software reviews, computer and internet tips, games, technology, downloads
advertise here

SQL LIKE Query Command

by Hiroshi on July 9th, 2007

LIKE sql command is used to retrieve or match records in different combinations to get desired result with wildcard. We will try LIKE sql query command and how to use it in our MySQL tables. But the best way to use LIKE query command is to apply it in a text or varchar field along with wildcard %.

SELECT * FROM student WHERE name LIKE '%John%'

We will get all the names where John word is present in the record. It can be any where. Please note the use of symbol % in the query. This will match any number of character even zero character before or after the word John. So we are getting the names those starts with John also. We may require the names which only starts with John not inside the name. In other words we want records starting with John only. In this case we will remove the use of % at the left of word John. Here is the SQL with LIKE command.

SELECT * FROM student WHERE name LIKE 'John%'

This list out all the names starting with name John. To display the records which does not have specific word John as the beginning we have change our LIKE sql command a little by changing the % position to the end of the word. Here we will allow any character even zero character to the left of the desired word not to the right

SELECT * FROM student WHERE name LIKE '%John'

This will have desired word John at the end only.

Topic: mySQL/phpMyAdmin, Tutorials
Tags: commands, like command in sql, mySQL/phpMyAdmin, query, sql like command
Post's RSS » RSS 2.0, Post's Comments RSS » RSS 2.0

Be Sociable, Share!
  • Tweet

    Related Posts

    • SQL ALTER Command
    • All Essential FTP Commands List
    • Most Wanted Windows DOS Commands
    • 99 Run Commands For Windows
    • Perform Any Task in Windows From Command Line Safely
    • PHP Easy Most Database Connection
    • MySQL server has gone away – Fix For WordPress Database Error
    • MySQL Query Is Not Updating Records

    Author

    Hiroshi (published 2148 Posts on TechMynd)

    My name is Hiroshi and I am behind the TechMynd. I have been working in the fields of Web Development, Animation, SEO and Web/ Graphics Designing. I am a Geek, Entrepreneur, Founder of TechMynd and some other web properties. Please read more in about page.

    Leave a Review

    Click here to cancel reply.

    Searches for Topic

    sql like command, like command in sql, android sql like, sql like phpmyadmin, android sql how to use where like, sql injection hotmail hacking, query for name start witha a specified character like in php admin, phpmyadmin sql where android, phpmyadmin sql like, like sql phpmyadmin, like sql phpadmin, like sql command, android sqlite LIKE, sql query like in phpmyadmin
    Search
    advertise here
    Join / Follow TechMynd
    Twitter follow techmynd at FaceBook Subscribe RSS Feeds Receive updates in Email
    Receive Updates in Email

    Affiliates
    How I Survived without AdSense - PDF eBook
    Jobs
    Windows 8
    iPhone Downloads - All in One
    Download iOS 4.3.1
    Download iOS 4.3.2
    Download iOS 4.3.3
    Downgrade iOS 4.3.3
    Download iOS 5 (Developer)
    Download iOS 5 (Direct)
    iPhone Firmwares

    Updates

    • Dreamhost Alerts User if Any Suspicious Script Found
    • Internet and SOPA
    • How to Access Offline English Wikipedia
    • Wikipedia Goes Offline Today
    • Sony Xperia ion and Xperia S
    • Wikipedia Will be Offline Globally to Protest SOPA and PIPA
    • MacX DVD Ripper Pro – 20 License Keys Giveaway
    • MacX iPhone Mounter Giveaway
    • MacX iPhone DVD Ripper Giveaway
    • MacX iPad DVD Video Converter Pack Giveaway
    • MacX Video Converter Pro Giveaway
    • IBM Next 5 in 5 2011
    • IBM Next Five in Five 2010
    • Technology in Year 2020 – Video
    • The Future of Mobile Communication
    Recommended Software
    Submit Articles or News

    Giveaways

    Giveaways Archive
    Giveaways How to and Help



    Home | About | blogging | Make Money | Web Hosting | Webmasters | OS Transformations | Advertise | Contact
    Downloads | Security | Internet/Web | Social Streams | Tips & Tricks | Tutorials | Goodies | Gaming Zone | WordPress | Everything Else | All Topics | Sitemap
    RSS Entries (2.0) | Comments (RSS) | Browser Friendly Feeds | .RSS 0.92 Feed | Atom Feed | RDF RSS 1.0 Feed.
    Privacy, Ads Policy | Subscription Methods
    © 2007 - 2011 - TechMynd - All Rights Reserved.