Skip to content
Advertisement

Problem in SQL query #1066 – Not unique table/alias

I have a problem with this query:

I get this error:

1066 – Not unique table/alias: ‘code’

Advertisement

Answer

The error seems pretty clear. You have mentioned code three times in the from clause. What does code refer to?

In your case, I think the solution is to remove all the references. The first should be the tags table — I think. The last doesn’t seem useful. So:

Note that I introduced table aliases. If you do need a second reference to code, you can just give it a new alias.

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