www.webdeveloper.com
Results 1 to 3 of 3

Thread: LIKE not working

  1. #1
    Join Date
    Jun 2011
    Posts
    23

    LIKE not working

    SELECT *
    FROM USERS
    WHERE USERS.USERNAME Like '%D%';

    This query simply shows no results, While

    SELECT *
    FROM USERS
    WHERE USERNAME NOT Like '%D%';

    Shows the whole table.

    I have a table called USERS, and a column called USERNAME, and a user called Danny. Why doesn't it work?

    Thanks!

  2. #2
    Join Date
    Jul 2010
    Location
    /ramdisk/
    Posts
    865
    That is a good question... try this one:

    Code:
    USE yourDataBaseName;
    
    SELECT *
    FROM `USERS`
    WHERE `USERS`.`USERNAME` Like 'D%';
    The only reason I say set the default schema (Use DBName) is that I'm not sure if you're looking at the MySQL database (which contains information required for MySQL to work-- kind of like information_schema).

  3. #3
    Join Date
    Jun 2011
    Posts
    23
    I found the problem: Access has different SQL standards (very surprising for the makers of IE), so the Wildcard is "*"...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles