Need help with the following issue related to loops in sql?

Hey @khatanaashish!

This post might help you with using the Multiselect component's array value in a SQL query:

https://community.retool.com/t/sql-cheatsheet-best-practices-for-different-flavors-of-sql-syntax/23902#use-arrays-in-queries-1

Also, let me know if it sounds like you're running into a Prepared Statements issue:

https://docs.retool.com/queries/guides/sql/queries#disable-prepared-statements

For your last question, it sounds like you need to change your column names before updating from Retool to match the column names in your database? If so, maybe something like this?

https://community.retool.com/t/mapping-a-column-value-to-a-db-columns-name/6812/3

FWIW, the new Table component shouldn't have this issue since you can set column ids vs labels, but I assume you have valid reasons for using the legacy Table!

Let me know if you have any questions :slight_smile: