Showing posts with label TipsMySQL. Show all posts
Showing posts with label TipsMySQL. Show all posts

Wednesday, December 20, 2006

Select column by comparing two table

Suppose you want to select column entries in a table based on anther table, how do you use SELECT by comparing two tables?

SELECT users.name FROM users, order WHERE order.custid = users.id

Syntax is just like a selecting column from table. Except you now have to use name of table with column name.