473,324 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Not unique table/alias

1
I have a problem joining two tables.
Expand|Select|Wrap|Line Numbers
  1. mysql> SELECT VARA.VID, VARA.ANTAL, VARA.PRIS, LEVERANTOR.LEVID, LEVERANTOR.TELEFONNUMMER FROM (VARA INNER JOIN LEVERANTOR ON VARA.VID=LEVERANTOR.LEVID) INNER JOIN VARA ON VARA.VID=LEVERANTOR.LEVID);
  2.  
I receive the following error:
ERROR 1066 (42000): Not unique table/alias: 'VARA'

I am using the MySQL 5,0 version. I seriously can't figure it out.
Attached Files
File Type: txt PROBLEM.txt (1.4 KB, 524 views)
May 19 '10 #1
1 5732
chathura86
227 100+
You are joining the table VARA two times so you need to use an alias for the tables.

eg.
Expand|Select|Wrap|Line Numbers
  1. SELECT V1.VID, V1.ANTAL, V1.PRIS, LEVERANTOR.LEVID, LEVERANTOR.TELEFONNUMMER FROM (VARA V1 INNER JOIN LEVERANTOR ON V1.VID=LEVERANTOR.LEVID) INNER JOIN VARA  V2 ON V2.VID=LEVERANTOR.LEVID);
May 20 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jack Tanner | last post by:
I have two complex subqueries that I need to join. I suspect this problem is due to using aliases instead of table names, but I don't know how to work around it (temporary tables?). Please help. ...
14
by: John | last post by:
Hi all, I am doing the change from having worked in Oracle for a long time to MS SQL server and am frustrated with a couple of simple SQL stmt's. Or at least they have always been easy. The...
2
by: Bill Holmes | last post by:
I have an A2003 front end (mdb) using ado to link the form/subforms to SQL server 2k tables and views. In SQL server, there is a view between 2 tables with a 1-1 relationship. I can edit records...
1
by: Amos | last post by:
Dear Sirs I am trying to build a cash flow software, first I thought to build one table for each cash and bank account, but talking to some people they suggested me to build one unique table for...
3
by: Rodríguez Rodríguez, Pere | last post by:
Hello, I think I have found a query problem when the query has an alias for a table and use alias item and table name. I ilustrate the problem with a simple table and query. prr=# create...
0
by: nassim.bouayad.agha | last post by:
Unique table version record Hello, I am using a table record to store informations about database dump,I use this table : CREATE TABLE dump_version( count BIGINT unsigned NOT NULL DEFAULT 0,...
5
by: No bother | last post by:
I am using 5.0.26-NT on Windows 2000. I have need to use a reference in the outer from clause in a subquery in the select clause. Consider the following example: Select (select b.baitID from...
2
by: tom1234 | last post by:
Hello I am trying to write an SQL statement that uses two derived tables / subqueries in a following way: SELECT * FROM tbl A ... INNER JOIN (SELECT * FROM tbl2 WHERE col...
0
by: teneesh | last post by:
I created a form in Access to store and retrieve data from a sql server table. When i go and try to add a record to the form - i get the error: Unique Table is nonexistent or not completely...
0
by: chichbong | last post by:
I have a form in an .adp file in Access 2007, and the project is connected to SQL Server 2005. The form uses a stored procedure to display records. The stored procedure does a JOIN of 2 tables, and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.