Quick note on CROSS JOIN

Example:
If you want to retrieve a last row of information from a table, you could search for the max/highest row ID that has been created in that table to be sure that you are working against the latest one.


"SELECT tblOne.* FROM tblOne, (SELECT MAX(ID) as maxID FROM tblOne) maxresults WHERE tblOne.ID = maxresults.maxID"


When you need a subquery in 1 query it's called a CROSS JOIN.

Written by: Dag Jonny Nedrelid
©2007-2012 http://thronic.com


Feel free to leave a comment.
Name:
URL:
0