Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to SELECT a common parameter and display in export using INNER JOIN?

The common parameter in all tables is ID (primary key).
Now I would like that the ID also appears in the export and at best then arrange all entries ascending with the ID.
But this seems to be not possible. PhpMyAdmin gives the error message
#1052 – Field ‘ID’ in field list is not unique.

Is there a way to export the ID as well?

My function has the following structure:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

SELECT name, age, date, ID FROM table t1 INNER JOIN table t2 ON t1.ID = t2.ID INNER JOIN table t3 ON t2.ID = t3.ID ORDER BY t1.ID ASC;

Table 1
ID
name

Table 2
ID
age

Table 3
ID
date

>Solution :

Your SELECT ID part seems vague. Perhaps be explicit and state t1.ID.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading