Project / Support Center
Welcome, %1$s. Please login or register. February 28, 2024, 11:12: AM
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL  |  : MYSQL selecting or showing record based on 2 different values in the same field 0 and 1 Guest are viewing this topic. « previous next »
: [1]
: MYSQL selecting or showing record based on 2 different values in the same field  ( 1885 )
admin
Administrator
******


: 239


« : May 15, 2023, 03:31: PM »

USE the OR attribute

Tells the query to look for this OR that value

SELECT *
FROM status_options_various
WHERE menu_group = 8 (this)
OR menu_group = 9 (that)

This will combine the output together and show both


To select values from 2 different fields use the AND attribute - Select This AND This

SELECT *
FROM status_options_various
WHERE menu_group = 8 (this)
AND menu_tax = 9 (this)
« : May 15, 2023, 03:39: PM admin »  

The Unknown Webmaster
: [1]  
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL  |  : MYSQL selecting or showing record based on 2 different values in the same field « previous next »
:  


Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!
Sorry, the copyright must be in the template.
Please notify this forum's administrator that this site is missing the copyright message for SMF so they can rectify the situation. Display of copyright is a legal requirement. For more information on this please visit the Simple Machines website.