http://www.datamartist.com/sql-inner-join-left-outer-join-full-outer-join-examples-with-syntax-for-sql-server

http://www.mysqltutorial.org/mysql-inner-join.aspx

http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/

Example:
$sql = "SELECT a.attendance_id, s.shift_name
FROM tbl_attendance AS a
INNER JOIN tbl_shift AS s
ON a.shift_id = s.shift_id
WHERE from_unixtime(a.date,'%Y%m%d')= $todays_date LIMIT 1";

Advertisements