I'm currently preparing a major Program-Update and ran into following problem: I've got a Table in a Mysql-Database that looks (roughly) like this:
+-----------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------+--------------+------+-----+---------+----------------+
| ID | int(15) | NO | PRI | NULL | auto_increment |
| Versionnumber | decimal(5,3) | NO | UNI | NULL | |
| ChangeLog | text | NO | | NULL | |
| ReleaseDate | datetime | NO | | NULL | |
| Enabled | tinyint(1) | NO | | 1 | |
+-----------------------+--------------+------+-----+---------+----------------+
Now I've changed the Columnname of the (former) Column 'ID' to 'VersionID'. This means the table now looks like this:
+-----------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------+--------------+------+-----+---------+----------------+
| VersionID | int(15) | NO | PRI | NULL | auto_increment |
| Versionnumber | decimal(5,3) | NO | UNI | NULL | |
| ChangeLog | text | NO | | NULL | |
| ReleaseDate | datetime | NO | | NULL | |
| Enabled | tinyint(1) | NO | | 1 | |
+-----------------------+--------------+------+-----+---------+----------------+
Now my question is the following: Is there a way to perform for example a 'SELECT' query without knowing exactly wether the Columnname is 'VersionID' or 'ID'? Something like (pseudo code)
SELECT (ID OR VersionID) AS VersionID FROM versions;
So what I'd need is something like a "Or-Clause" for the Columnname. Does something like that exist?
Thanks for your help!