Hi all,

I'm working on the interface side of a group project and just plain don't understand a query that I have to work with. We're looking for the time difference between events:

$sql = "SELECT
x.date AS x,
y.date AS y
FROM table
WHERE x.event = 1 AND y.event = 1
ORDER BY x.date - y.date DESC;";

Basically, I don't understand the concept. I do understand basic aliases, but I didn't know that you could put a "x." or a "y." in front of a column name (what is this syntax even called?). Does the x.date and y.date refer to the exact same row?

If anyone would mind giving an explanation of this, I would really appreciate it. Thanks in advance--