Go Back   CodingForums.com > :: Server side development > MySQL > Other Databases

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 10-17-2012, 07:26 AM   PM User | #1
crewson548
New Coder

 
Join Date: Oct 2012
Posts: 11
Thanks: 3
Thanked 0 Times in 0 Posts
crewson548 is an unknown quantity at this point
What is the question mark '?' in SQL

Can any one know the exact knowledge on this.. plz help me..
crewson548 is offline   Reply With Quote
Old 10-17-2012, 03:28 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,365
Thanks: 18
Thanked 348 Times in 347 Posts
sunfighter is on a distinguished road
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.
sunfighter is offline   Reply With Quote
Old 10-17-2012, 04:13 PM   PM User | #3
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
This isn't right. MySQL doesn't use the ? for a character wildcard, it uses _. So ? is likely used in a prepared statement.
Fou-Lu is offline   Reply With Quote
Old 10-17-2012, 09:39 PM   PM User | #4
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,365
Thanks: 18
Thanked 348 Times in 347 Posts
sunfighter is on a distinguished road
Your right. Should not have trusted my brain and gone to w3schools like I keep telling others.
sunfighter is offline   Reply With Quote
Old 10-17-2012, 09:59 PM   PM User | #5
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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 _.
Fou-Lu is offline   Reply With Quote
Old 10-18-2012, 10:28 AM   PM User | #6
crewson548
New Coder

 
Join Date: Oct 2012
Posts: 11
Thanks: 3
Thanked 0 Times in 0 Posts
crewson548 is an unknown quantity at this point
Thumbs up

Thanks for all...
I got a clean idea about this question...
crewson548 is offline   Reply With Quote
Old 10-18-2012, 09:44 PM   PM User | #7
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,447
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
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/
felgall is offline   Reply With Quote
Old 10-19-2012, 10:27 AM   PM User | #8
crewson548
New Coder

 
Join Date: Oct 2012
Posts: 11
Thanks: 3
Thanked 0 Times in 0 Posts
crewson548 is an unknown quantity at this point
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...
crewson548 is offline   Reply With Quote
Old 10-19-2012, 06:07 PM   PM User | #9
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
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.
guelphdad 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 10:44 PM.


Advertisement
Log in to turn off these ads.