Jump to content

SELECT STATEMENT


jakebur01

Recommended Posts

Well, Store can't equal two values at the same time unless the two values are equal, and they're not.

 

 

So, sounds like maybe you're looking for an OR?

 

 

SELECT * FROM extreme where `State` = 'AK' and (`Store` = 'B & R' OR `Store` = 'Extreme') order by City

 

 

By the way, ` are used only in the MySQL SQL dialect, and they're only useful if the object is a reserved word, so they should typically be avoided.  (They detract from SQL compatibility, and reserved words shouldn't ever be used anyway.)

Link to comment
https://forums.phpfreaks.com/topic/177130-select-statement/#findComment-933983
Share on other sites

By the way, ` are used only in the MySQL SQL dialect, and they're only useful if the object is a reserved word, so they should typically be avoided.  (They detract from SQL compatibility, and reserved words shouldn't ever be used anyway.)

 

You can easily abstract yourself out of that problem.

Link to comment
https://forums.phpfreaks.com/topic/177130-select-statement/#findComment-933984
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.