Mysql - Horribly troublesom problem!!!!
Posted: Wed Sep 16, 2009 7:47 am
G'day,
I have a problem which has been giving me trouble for some time.
I'm trying to query my DB, but i need to find how many times a comparison returns true.
For example.. i have the following query:
I need to know how many times a given drink name returns true.
I require an output similar to:
Cheers
I have a problem which has been giving me trouble for some time.
I'm trying to query my DB, but i need to find how many times a comparison returns true.
For example.. i have the following query:
The above returns only distinct drinks that have hits, noting specific.SELECT distinct(drinkName) FROM ingredientamount WHERE ingredientID='11' XOR ingredientID='14' XOR ingredientID='6' XOR ingredientID='7' XOR ingredientID='101' XOR ingredientID='111' XOR ingredientID='114' XOR ingredientID='118' XOR ingredientID='97' XOR ingredientID='47' XOR ingredientID='48' XOR ingredientID='50' XOR ingredientID='51' XOR ingredientID='52' XOR ingredientID='53' XOR ingredientID='55' XOR ingredientID='58' XOR ingredientID='62' XOR ingredientID='63' XOR ingredientID='83' XOR ingredientID='86' XOR ingredientID='89' XOR ingredientID='92'
I need to know how many times a given drink name returns true.
I require an output similar to:
If someone could please get back to me ASAP, it would be VERY MUCH appreciated !!!"Bay Breeze (5/5 ingredients)"
"Bloody Mary (4/10 ingredients)"
Cheers