简体   繁体   中英

#1066 - Not unique table/alias: error while running an command

Ihave created 2foreign keys customer id and now iam tryin to run this command to getan output but get this error#1066 - Not unique table/alias: enter code here { SELECT productid FROM javabase . sales JOIN sales on sales . customerid = customer . customerid where customer . customername = Babu ; }

You have to use at least one alias when you join a table to itself. So instead of FROM sales JOIN sales it would be FROM sales S1 JOIN sales S2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM