473,549 Members | 2,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"not unique table/alias"

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.

SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
JOIN t1 ON t2.col = t1.col;
Not unique table/alias: 't1'.
SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
WHERE t2.col = t1.col;
Works fine! (But this query is different, because it doesn't get

the rows that are NULL in one of the tables.)

Using MySQL 4.1.1. Thanks in advance for your help.
Jul 20 '05 #1
6 34885
"Jack Tanner" <ih**@hotmail.c om> wrote in message
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.

SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
JOIN t1 ON t2.col = t1.col;
Not unique table/alias: 't1'.
SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
WHERE t2.col = t1.col;
Works fine! (But this query is different, because it doesn't get

the rows that are NULL in one of the tables.)

Using MySQL 4.1.1. Thanks in advance for your help.


Looks like a bug.
Jul 20 '05 #2
"Jack Tanner" <ih**@hotmail.c om> wrote in message
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.

SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
JOIN t1 ON t2.col = t1.col;
Not unique table/alias: 't1'.
SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
WHERE t2.col = t1.col;
Works fine! (But this query is different, because it doesn't get

the rows that are NULL in one of the tables.)

Using MySQL 4.1.1. Thanks in advance for your help.


Looks like a bug.
Jul 20 '05 #3
"Siemel Naran" <Si*********@RE MOVE.att.net> wrote in message news:<5T******* **************@ bgtnsc05-news.ops.worldn et.att.net>...
"Jack Tanner" <ih**@hotmail.c om> wrote in message
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.

SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
JOIN t1 ON t2.col = t1.col;
>> Not unique table/alias: 't1'.


SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
WHERE t2.col = t1.col;
>> Works fine! (But this query is different, because it doesn't get

the rows that are NULL in one of the tables.)

Using MySQL 4.1.1. Thanks in advance for your help.


Looks like a bug.


Could someone from @mysql.com confirm this? Should I be reporting on bugs.mysql.com?
Jul 20 '05 #4
"Siemel Naran" <Si*********@RE MOVE.att.net> wrote in message news:<5T******* **************@ bgtnsc05-news.ops.worldn et.att.net>...
"Jack Tanner" <ih**@hotmail.c om> wrote in message
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.

SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
JOIN t1 ON t2.col = t1.col;
>> Not unique table/alias: 't1'.


SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
WHERE t2.col = t1.col;
>> Works fine! (But this query is different, because it doesn't get

the rows that are NULL in one of the tables.)

Using MySQL 4.1.1. Thanks in advance for your help.


Looks like a bug.


Could someone from @mysql.com confirm this? Should I be reporting on bugs.mysql.com?
Jul 20 '05 #5
Jack Tanner wrote:
Not unique table/alias: 't1'.


I don't know if this helps you, but I have always done it differently.
See the examples:

mysql> select * from t1,t2 left join t1 on t1.id=t2.id;
ERROR 1066: Not unique table/alias: 't1'

mysql> select * from t1 left join t2 on t1.id=t2.id;
+------+------+------+------+
| id | name | id | name |
+------+------+------+------+
| 1 | car | 1 | cat |
| 2 | cube | NULL | NULL |
+------+------+------+------+
2 rows in set (0.00 sec)

# Or if you want to use aliases:
mysql> select * from t1 as k1 left join t2 as k2 on k1.id=k2.id;

I have version 3 of MySQL so can't try with subqueries. And I don't
whether you are supposed to be able to do it the way you tried or not.
Jul 20 '05 #6
Jack Tanner wrote:
Not unique table/alias: 't1'.


I don't know if this helps you, but I have always done it differently.
See the examples:

mysql> select * from t1,t2 left join t1 on t1.id=t2.id;
ERROR 1066: Not unique table/alias: 't1'

mysql> select * from t1 left join t2 on t1.id=t2.id;
+------+------+------+------+
| id | name | id | name |
+------+------+------+------+
| 1 | car | 1 | cat |
| 2 | cube | NULL | NULL |
+------+------+------+------+
2 rows in set (0.00 sec)

# Or if you want to use aliases:
mysql> select * from t1 as k1 left join t2 as k2 on k1.id=k2.id;

I have version 3 of MySQL so can't try with subqueries. And I don't
whether you are supposed to be able to do it the way you tried or not.
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
3838
by: black tractor | last post by:
HI there.. l was just wondering, if l place a "table" in the "editable region" of my template, will the text, graphics placed inside the this "table" MOVE BY ITSELF?? l mean, recently l had a "table" insert in my "editable region", have it placed in the "center" of the page.. while it display correctly on my browser, with setting at...
5
14772
by: Rolf Brauser | last post by:
Hi, I want to have a table with a border of 1px arround it but table="1" is more than a pixel because this 3d effect is attached. Values below are not accepted How can I get this border with 1px can someone give me any hints ? thanks for any help
72
4150
by: Paminu | last post by:
In math this expression: (a < b) && (b < c) would be described as: a < b < c But why is it that in C these two expressions evaluate to something different for the same values of a, b and c?
0
401
by: Marty Scholes | last post by:
I may have found a bug. I have a table: CREATE TABLE onlpcd_stat ( sel BIGSERIAL PRIMARY KEY, user_id INTEGER NOT NULL REFERENCES onlpcd_user ON DELETE CASCADE, vars TEXT, /* string of Perl var hash */ cre_ts TIMESTAMP DEFAULT NOW()
5
1827
by: kiask2343 | last post by:
Ok before I get started let it be known I am the definition of a newbie when it comes to access and VBA. I know very little about access and nothing about VBA. I am in the Army and am tasked with making a maintenance program for medical equipment. I have the database, the query, the forms, and the reports. I was able to figure those out, but...
3
1654
by: perryclisbee via AccessMonster.com | last post by:
I have a query where I need all of the results to be assigned a single tracking number. Example: I run the query for all claims within a certain date parameter, for 10 different patient codes. This produces 50 rows of data. I want to give this series of results the same identical tracking number that will show up on each row in the field ....
2
6658
by: kilo | last post by:
Hey.. I need someone hwo can help me making my sql table.. I have no php skills. I have payed for a php program that shoud make dictation for people that have some problems reading danish.. with sound and text.. When I'm making the dictation with PHP I'm getting an error like this.: Query failed (SELECT word FROM repository): Table...
3
12327
by: VRSki | last post by:
Hello, Is there any way to use "using" for aliasing in the global scope? The example below works fine in the context of a given file, but in the different file MyByte alias is unknown. Is there any way to extend its visibility to multiple files without redefining it? using MyByte=System.Byte;
6
26278
jinalpatel
by: jinalpatel | last post by:
I am getting this error when I try to enforce referencial integrity from Harvest II table to tractsum table I have attached the relationship diagram. Please give me the hint about possibilities of situation why this error occurs? Thanks
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7715
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7808
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.