Need some SQL query assist

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.

2X_2_29b73e50062acd929c195684cf174f0f0b5214b6.png

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 Solved
0 12 986
1 ACCEPTED 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.

View solution in original post

12 REPLIES 12
Top Labels in this Space