Skip to content

Instantly share code, notes, and snippets.

@erikbgithub
Created July 24, 2012 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikbgithub/3170228 to your computer and use it in GitHub Desktop.
Save erikbgithub/3170228 to your computer and use it in GitHub Desktop.
mysql> select * from german;
+----+-------+
| id | word |
+----+-------+
| 1 | hallo |
| 2 | welt |
+----+-------+
2 rows in set (0.00 sec)
mysql> select * from english;
+----+-------+
| id | word |
+----+-------+
| 1 | hello |
| 2 | world |
+----+-------+
2 rows in set (0.00 sec)
mysql> select german.word, english.word from german, english;
+-------+-------+
| word | word |
+-------+-------+
| hallo | hello |
| welt | hello |
| hallo | world |
| welt | world |
+-------+-------+
4 rows in set (0.00 sec)
mysql> select german.word, english.word from german, english where id=id;
ERROR 1052 (23000): Column 'id' in where clause is ambiguous
mysql> select german.word, english.word from german, english where german.id=english.id;
+-------+-------+
| word | word |
+-------+-------+
| hallo | hello |
| welt | world |
+-------+-------+
2 rows in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment