I have an odd situation I am trying to handle. In a mySQL SELECT query, I need to have a field, not coming from the database, that just counts up from 0 for each record returned.
For background info, I have to query a table of addresses, which currently looks like this:
SELECT
addressID,
address_1,
address_2,
city,
state,
zipcode,
country,
county,
address_type
FROM employee_address
WHERE employee_id = 1234
Each record returned opens a new instance of a template of form fields in java, populated with the address info.
But I need a dummy field that just counts up from 0 for each record returned, that can be assigned to each template as an "index", which is used for reference later in my python coding (without this I have no index to go by at a later point in the code). Hopefully something like this
SELECT
increment(0) AS templateID,
addressID,
address_1,
address_2,
city,
state,
zipcode,
country,
county,
address_type
FROM employee_address
WHERE employee_id = 1234
And unfortunately I don't have access to change the java code to just give the templates an index value. Sad but true.