Hi all,
I´ve the following problem:
2 tables. The first (table1) has a column id and the second some names.
Now I have the second table with a field that has e.g. the following value:
"6 3 9"
(id=6 id=3 id=9)
My query:
SELECT id, names from table1 WHERE id IN (6, 3, 9)
The result looks like this:
id names
3 blabla
6 XXXXX
9 galalala
But I want to have the result in the right order like this:
id names
6 XXXXX
3 blabla
9 galalala
How can I get this?
I could do 3 queries like "SELECT id, names from tableX WHERE id=6" + "SELECT id, names from tableX WHERE id=3" but this not what i want.
Thx for your help
I´ve the following problem:
2 tables. The first (table1) has a column id and the second some names.
Now I have the second table with a field that has e.g. the following value:
"6 3 9"
(id=6 id=3 id=9)
My query:
SELECT id, names from table1 WHERE id IN (6, 3, 9)
The result looks like this:
id names
3 blabla
6 XXXXX
9 galalala
But I want to have the result in the right order like this:
id names
6 XXXXX
3 blabla
9 galalala
How can I get this?
I could do 3 queries like "SELECT id, names from tableX WHERE id=6" + "SELECT id, names from tableX WHERE id=3" but this not what i want.
Thx for your help