sqlite select all values with specific id

Viewed 104

How can I get the results from my table where I can see all the values of a specific id? I am using sqlite3 and python3.

my table:

id         value
123        val1
123        val3
123        val2
124        val2
124        val1

Result that I want:

123          val1, val3, val2
124          val2, val1

My query:

SELECT * FROM table GROUP BY id

Result:

(123, 'val1')
(124, 'val2')
1 Answers

Try this.

Select * from table where id =123 AND 124

Related