Skip to content
Advertisement

Can’t return column table when the table have just FK?

When I choose a table when it doesn’t have any Primary Key, my query returns nothing. So what’s the problem in this query?

This is result when I have pkin my table:

enter image description here

And this is result when I haven’t pkin my table:

enter image description here

Here is the query:

Advertisement

Answer

As you are putting INNER JOIN with PRIMARY KEY constraint, as given below, only the tables with PRIMARY KEY are returned in the result set.

If you change them to LEFT OUTER JOIN, you will get tables without PRIMARY KEY and just FOREIGN KEY also

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