Lookin for some MySQL query help (rookie here).
I have a table with IDs, and other tables with various datas that I want to filter based on the ID being inside the first mentioned table.
I’m this close, but some syntax is killing me here.
something like this, but it’s not right.
Any help would be appreciated.
All I keep finding is stuff about Joins… I don’t want to JOIN anything; I have a list of IDs that their data needs to be cleared out of the active system.
Solved! Go to Solution.
The c.* and AS c is just so that you can only return the columns from the CARDIAC_MEDS Table.
Try
SELECT * FROM CARDIAC_MEDS WHERE Cardiac_Meds.Patient_Link IN (SELECT * FROM Dead_Patients)
A Join would work here although I think it would be a RIGHT JOIN since you only want the results that are in Dead_Patients.
User | Count |
---|---|
44 | |
35 | |
24 | |
23 | |
15 |