Sorting Condition - Ambiguous Column Error

Wappler Version : 2.1.0

Operating System : Windows 10

Expected behavior

On selecting a column in sorting tab of query builder, it shows the column name with table alias.

Actual behavior

The table alias is just shown in the builder UI & is not placed when actually running the query.
With debug flag on, this is what the query is shown as:

"SELECT `actions`.`id`, `actions`.`name`, `actions`.`action_priority` FROM `cng_campaign_queries` LEFT JOIN `m_custom_action` AS `actions` ON `actions`.`custom_query_id` =`cng_campaign_queries`.`query_id` WHERE `cng_campaign_queries`.`campaign_id` =? ORDER BY `sort_index` ASC, `action_priority` ASC"

Both my tables in the join have sort_index field, which is causing the ambiguous column error.

How to reproduce

Server setting: IIS & ASP.NET
DB setting: MySQL ODBC 8.0
This is what is shown in the builder UI:

DatabaseConnector.zip (27.9 KB)

Here an update, please test it. Just replace the files from the Bin folder.

Working now. Thanks. :slight_smile:

@patrick Ran into another error. IS NOT NULL? condition is getting rendered with a question mark at the end, which is throwing an error.

That is strange, when does that happen?

Nothing specific. Just adding a condition with operator as IS NOT NULL from the drop down renders the query with ? at the end of it.
I even tried changing position among the three conditions that I have, but no luck.