I'm really confused about this query. I would like to get all the data for one context in one row. I really don't know how to do that. Here's the tables's sample.
data (table) io(table)
IDData IDIO ReadVal No IDIO IDContext
1 io1 12 1 io1 c1
2 io2 12.5 2 io2 c1
3 io3 11 3 io3 c1
4 io4 12.2 1 io4 c2
5 io5 10 2 io5 c2
6 io6 10.9 3 io6 c2
I would like to get this result
IDContext IO-1 IO-2 IO-3
c1 12 12.5 11
c2 12.2 10 10.9
I've tried to do this in a loop to print in a table and it works, but I would like to do it in a query so it will be faster.
Actually, my query looks like that :
SELECT IDContext, IDInput, ReadVal
FROM data
LEFT JOIN io ON io.IDIO = data.IDIO
ORDER BY IDContext, No
Is this possible to get that result in one single query?