Name | Status | value -----+-------------+------- wec1 | rotortemp | Null wec1 | baldetemp | Null wec1 | Cabinettemp | 1 wec2 | rotortemp | Null wec2 | baldetemp | Null wec2 | Cabinettemp | Null
How can I select all the wec1 because the value of one row of wec1 is = 1
Try this:
SELECT *
FROM TableName
WHERE Name IN (SELECT Name
FROM TableName
WHERE value=1)