Skip to content
Advertisement

SQL trying to use a column from a joined table in a subquery

Here is what I currently have which returns 3 columns for patient_id, group_concat_1, and group_concat_2:

However, I need to return a single column with group_concat_1 and group_concat_2 combined, so I tried this:

But his clearly doesn’t work since now it can’t find patient.id in the inner subquery. Any advice? Thanks!

Advertisement

Answer

You can concatenate directly the 2 columns:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement