Dear Steve et al,
I am trying to combine two queries in one that should appear as a grid. So inside the relationships.ini I have:
__sql__ = "
SELECT objectID AS id, box
FROM object
WHERE object.objectID LIKE 'A%'
AND object.campaignID = 'LY22'
AND '$type'='object'
UNION ALL
SELECT notable_pottery.notable_potteryID AS id, box
FROM notable_pottery
WHERE notable_pottery.notable_potteryID LIKE 'A%'
AND notable_pottery.campaignID = 'LY22'
AND '$type'='notable_pottery'
"
If I am not mistaken, the problem is that objectID AS id does not work since the same query (without the $type parameters) works on phpMyAdmin. Moreover, when I reduce the query to the following, the table appears as objectID and not id:
__sql__ = "
SELECT objectID AS id, box
FROM object
WHERE object.objectID LIKE 'A%'
AND object.campaignID = 'LY22'
AND '$type'='object'
"
I have also tried wrapping the id in backticks with no result, and I get a white screen when I wrap it inside single quotation marks.
Do you have any ideas on how I can solve this renaming of column issue please?
Thank you!