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 9 of 9
  1. #1
    New Coder
    Join Date
    Oct 2012
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    What is the question mark '?' in SQL

    Can any one know the exact knowledge on this.. plz help me..

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,287
    Thanks
    23
    Thanked 611 Times in 610 Posts
    It depends on where it's at. Most common use is in a LIKE statement, it is a single character wild card.
    ex; LIKE = ???toon will give you all things that has toon with three letters before it such as cartoon or flytoon or bumtoon. See also the * wild card and the %.

    I know it appears in the WHERE statement as a variable placeholder that will be filled in, but don't know how that works.

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    This isn't right. MySQL doesn't use the ? for a character wildcard, it uses _. So ? is likely used in a prepared statement.

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,287
    Thanks
    23
    Thanked 611 Times in 610 Posts
    Your right. Should not have trusted my brain and gone to w3schools like I keep telling others.

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Wait, I just noticed this is in other databases and not mysql.
    In which case you're not wrong. MySQL uses % and _, but not all db's do. The OP would need to specify; I know Access for example uses * and ? for theirs. That's an old standard too though, and access 2007 (I think its by default in 89), can be converted to ansi 92 to support % and _.

  • #6
    New Coder
    Join Date
    Oct 2012
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Thumbs up

    Thanks for all...
    I got a clean idea about this question...

  • #7
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by sunfighter View Post
    Your right. Should not have trusted my brain and gone to w3schools like I keep telling others.
    Yes w3schools is full of errors and outdated coding methods - best avoided.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #8
    New Coder
    Join Date
    Oct 2012
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    Your right. Should not have trusted my brain and gone to w3schools like I keep telling others.
    Is that w3schools books are that much special.. can i get answers to my questions...

  • #9
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    You can't get an answer to your question because you are not clear enough in what you are asking.

    Please provide an example of what you actually want answered. There can be a number of answers, one of which may be right, depending on where the ? appears in the statement.

    Also let us know what database you are using.


  •  

    Posting Permissions

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