怎么看淘宝直通车怎么看排名关键词排名

10533人阅读
C++(123)
数据库(34)
内容如下:
Not unique table/alias
错误编号:1066
问题分析:
SQL 语句中出现了非唯一的表或别名。
解决方法:
1、请检查出现问题位置的 SQL 语句中是否使用了相同的表名,或是定义了相同的表别名。
2、检查 SELECT 语句中要查询的字段名是不是定义重复,或者没有定义。
调试程序的时候发现,果真是调用MySQL的mysql_real_query()方法执行查询的时候,同时使用了&left join table1&和&from table1&两个项,从而导致出现该错误提示。
解决方法:
使用正确的SQL语句即可。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:832732次
积分:9621
积分:9621
排名:第1416名
原创:187篇
转载:125篇
评论:70条
(38)(42)(20)(35)(48)(23)(29)(49)(25)(3)backup - mysqldump: Got error: 1066: Not unique table/alias: 'foo' when using LOCK TABLES when lower_case_table_names=1 - Server Fault
to customize your list.
Server Fault is a question and answer site for system and network administrators. J it only takes a minute:
Here's how it works:
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I'm trying to dump a MYSQL DB on a linux server (Centos 5.2 32bit, MySQL 5.0.45)
In /f the following value is defined:
lower_case_table_names=1
When I try and do a dump with mysqldump I get the following error:
[root@linuxbox backups]# mysqldump --user=root --password=secret
--result-file=/tmp/out.sql--all-databases
mysqldump: Got error: 1066: Not unique table/alias: 'foo' when using LOCK TABLES
I can't figure out what I need to do to work around this, and we can't set lower_case_table_names to 0 f because that will break some things that require case insensative table names.
How can I do a mysqldump in this situation?
(or, another way to make a backup of the DB to file would work since that is the goal)
2,755145593
Rename one of the conflicting relations.
77.4k12118186
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Server Fault works best with JavaScript enabled1、错误描述1 queries executed, 0 success, 1 errors, 0 warnings
查询:SELECT (SELECT CONCAT( s.name, '/', sr.reame, '[', DATE_FORMAT(a.startTime, '%Y-%m-%d'), ']' ) FROM t_stu_info a, t_...
错误代码: 1066
Not unique table/alias: 'c'
: 0.001 sec2、错误原因& & &在拼接SQL语句时,给t_stu_amount 和t_tea_info 取别名时,都取c& & &... from t_stu_info a,t_stu_amount c,t_tea_info c& & &导致表别名重复3、解决办法& & &将两个表的别名改为不一样的,如&... from t_stu_info a,t_stu_amount c,t_tea_info o
版权声明:本文为博主原创,未经博主允许不得转载。mysql - #1066 - error not unique table alias - Stack Overflow
to customize your list.
Join the Stack Overflow Community
Stack Overflow is a community of 6.5 million programmers, just like you, helping each other.
J it only takes a minute:
I am learning mysql and I am having trouble with one of my tables which produces #1066 - error not unique table alias. I have tried a number of different queries but all have the same result. Can someone put me out of my misery and help point out what I am doing wrong! - Thanks
look_id(Pk)
description
date_modified
Add_Look_Item
-----------------------
look_id (fk from table 1)
item_id (fk from table 3)
--------------
item_id (pk)
Add_Images
-------------------
image_id (pk)
item_id (fk from table 3)
image_name
Queries I have tried - add_look_item is a compound key
SELECT DISTINCT looks.look_id, looks.title, looks.date_modified, add_look_item.item_id,
add_images.image_name FROM looks JOIN add_look_item ON add_look_item.look_id = looks.look_id
JOIN add_look_item ON add_look_item.item_id = item.item_id WHERE look.user_id = 94
#1066 - error not unique table alias 'add_look_item
SELECT DISTINCT looks.look_id, looks.title, looks.date_modified, add_look_item.item_id,
add_images.image_name FROM looks JOIN
add_look_item ON add_look_item.looks_id = look.look_id
JOIN add_look_item ON add_look_item.item_id = item.item_id
JOIN add_images ON add_images.item_id = item.item_id WHERE add_look_item.item_id =
item.item_id AND look.user_id = 94
#1066 - error not unique table alias 'add_look_item
SELECT DISTINCT looks.look_id, looks.title, looks.date_modified, add_look_item.item_id,
add_images.image_name FROM looks INNER JOIN add_look_item ON add_look_item.look_id =
look_look_id
INNER JOIN add_images ON add_images.item_id = item.item_id
INNER JOIN add_look_item ON add_look_item.item_id = item.item_id
WHERE look.user_id = 94
#1066 - error not unique table alias 'add_look_item
SELECT DISTINCT looks.look_id, looks.title, looks.date_modified, add_look_item.item_id,
add_images.image_name FROM looks
INNER JOIN add_look_item ON add_look_item.looks_id = look.look_id
INNER JOIN add_images ON add_images.item_id = item.item_id
INNER JOIN add_look_item ON add_look_item.item_id = item.item_id
WHERE add_look_item.item_id = item.item_id AND look.user_id = 94
#1066 - error not unique table alias 'add_look_item
SELECT DISTINCT looks.look_id, looks.title, looks.date_modified, add_look_item.item_id,
add_images.image_name FROM looks
INNER JOIN add_look_item ON add_look_item.looks_id = look.look_id
INNER JOIN add_images ON add_images.item_id = item.item_id
WHERE add_look_item.item_id = item.item_id AND look.user_id = 94
#1054 - Unknown column 'item.item_id' in 'where clause'
Try this -
SELECT looks.look_id, looks.title, looks.date_modified, add_look_item.item_id, add_images.image_name
FROM looks
JOIN add_look_item
ON looks.look_id = add_look_item.look_id
JOIN add_images
ON add_look_item.item_id = add_images.item_id
WHERE look.user_id = 94
Make an alias for add_look_item since you are joining it multiple times.
For example:
SELECT tbl.a, a.y, b.y
JOIN tbl2 as a ON tbl.x = a.x
JOIN tbl2 as b ON tbl.x = b.x
Otherwise the query engine won't know what to do :)
40.7k1065114
3,46911019
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled

我要回帖

更多关于 直通车关键词排名查询 的文章

 

随机推荐