I think this should be quite simple but i just can't seem to figure it out.
I have 2 tables. Table A and table B are joined by a field which are the same value.
I want to select all rows from table A. From table B, I want to select all joined to table A where a column in table A is a specific value.
This is how I see it working
SELECT tableA.*, (SELECT * FROM tableB INNER JOIN tableA on tableB.id = tableA.id WHERE tableA.complete = 1) FROM tableA
I have run this code but i get this error
Operand should contain 1 column(s)
How can i get all values from table A and joining rows from table B where table A column is 1?
EDIT:
This is what I expect output should be
Table_A.someID Table_A.col Table_A.complete Table_B.someID Table_B.col
----------------|----------------|---------------------|-------------------|----------------
123 | something | 1 | 123 | value
124 | something | 1 | 124 | value
125 | something | 1 | 125 | value
126 | something | 0 | |
127 | something | 0 | |
I want all rows from Table A regardless of column complete value and from Table B any row that links to Table A and complete is 1.
If you need anymore explanation i'll explain more