Is it possible to join the results of 2 sql SELECT statements as one statement where both are query the same tables, and look for values in the same column?
I want to have the id of a task (which is fine) but then I want to filter out certain values into 2 separate columns.
Currently I get get the data in 2 separately:
SELECT id, string_value as Station FROM table WHERE datatype= 'station'
(column datatype doesn’t need to be seen)
returns something like:
id Station
task1 station1
task2 station2
and then I have
SELECT id, string_value as RespondingAction FROM table
WHERE datatype='RespondingAction'
returning:
id RespondingAction
task1 Approve
task2 Decline
I want to basically combine these 2 queries, but I’m not sure how as they both look for the data in the same column. Hopefully the end result would be something like this:
id Station RespondingAction
task1 station1 Approve
task2 station2 Decline
task3 station1 Decline
task4 station3 Pending (if null)
Sorry if this isn’t too clear; I’m new to this and trying my best to work this out!
EDIT
you can also try to replace
by