Topic: [Solved] Button SQL Query not working ?
Hello Dmitry,
The normal SQLQuery button works fine. A query like
SELECT
artist.id,
artist.artist_name
FROM
tmp_table
INNER JOIN artist ON artist.id = tmp_table.id1
INNER JOIN vendor ON vendor.id = tmp_table.id3
WHERE tmp_table.flag = 'art'
ORDER BY upper(artist_name) ASC
works fine, and even with 'delete_col, Artist Name' as colums titles, the ID of the record is found without problem
Bu then I needed to fill 1 Tablegrid with the results of 2 queries, so I wrote a query like :
SELECT
artist.id,
artist.artist_name
FROM
artist
INNER JOIN tmp_table ON artist.id = tmp_table.id1
UNION
SELECT
artist.id,
artist.artist_name
FROM
artist
INNER JOIN artist_asset ON artist_asset.id_artist = artist.id
WHERE artist_asset.id_asset = {edAID}
The results of those two queries in one are displayed as expected in the Tablegrid, this works fine, but the ID of the record (dbItemID) seems to be lots in the process... Clicking in the tablegrid to get the ID gives a result of -1;
Is this due to the use of the UNION in my query ?
Cheers
Mathias
Each time I get a divorce, I keep the house
Zaza Gabor