By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,722 Members | 1,227 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,722 IT Pros & Developers. It's quick & easy.

showing mysql fields as NULL

P: n/a
red
i want to output the empty fields in one table to show up as NULL in my
query. I tried using left join but couldn't get it to work. Here's my
first try:
SELECT * FROM info left join info on id=1
query failed:1066: Not unique table/alias: 'info'
Since left join usually uses two tables, I also tried using an alias,
but I got the same error message.
SELECT * FROM info as alias left join alias on id=1
query failed:1066: Not unique table/alias: 'alias'

What as missing ?
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
>i want to output the empty fields in one table to show up as NULL in my
query. I tried using left join but couldn't get it to work. Here's my
first try:
SELECT * FROM info left join info on id=1
query failed:1066: Not unique table/alias: 'info'
Since left join usually uses two tables, I also tried using an alias,
but I got the same error message.
SELECT * FROM info as alias left join alias on id=1
query failed:1066: Not unique table/alias: 'alias'

What as missing ?


Give the two instances of the table *DIFFERENT* aliases.

SELECT * FROM info a LEFT JOIN info b ON a.parent = b.id WHERE b.id = 1;

Gordon L. Burditt
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.