mysql in operator
Posted: Mon Mar 19, 2007 11:40 am
hi,
im having a small problem with this:
SELECT ingid FROM ingredients WHERE name IN ("spaghetti","chips","mince");
the ids for these dishes are
spaghetti -7
chips -10
mince 8
the stament above returns them in ascending order. how can i get this statement to return them in order of input - 7,10,8??
this is a statement from some php i am doing, it all works but i NEED them to be in the order of input
does anyone know?
thanks!
im having a small problem with this:
SELECT ingid FROM ingredients WHERE name IN ("spaghetti","chips","mince");
the ids for these dishes are
spaghetti -7
chips -10
mince 8
the stament above returns them in ascending order. how can i get this statement to return them in order of input - 7,10,8??
this is a statement from some php i am doing, it all works but i NEED them to be in the order of input
does anyone know?
thanks!