I have a table I want to join twice in one SELECT statement and I can do it just fine. However, the column I want that gets pulled in has the same name in both instances and I don't know how to name them uniquely. Here is a stripped down version of what I'm trying to do:
The table 'alerts' has only 2 columns - 'alertID' and 'alert'. I want to know how I can rename the 'alert' column to have a unique name for both instances of it. Right now the way the query runs it returns 2 columns named simply 'alert'.
Help would be much appreciated on this issue... I've looked around for advice to no avail. Anyone?
Code:
SELECT * FROM jobs
LEFT JOIN alerts AS jobStatusAlerts ON jobStatuses.alertID=jobStatusAlerts.alertID
LEFT JOIN alerts AS priorityAlerts ON priorities.alertID=priorityAlerts.alertID
The table 'alerts' has only 2 columns - 'alertID' and 'alert'. I want to know how I can rename the 'alert' column to have a unique name for both instances of it. Right now the way the query runs it returns 2 columns named simply 'alert'.
Help would be much appreciated on this issue... I've looked around for advice to no avail. Anyone?