please try to use IN operator in sql statement for better result or provide some sample data and what you are exactly looking to debug by other experts and developers. give examples for faster retrieval and provide workbooks with twbx for checking/debugging issue.
Thank you, cause the workbook need connect to database, so I can't upload a twbx for debug. The problem is I have set a string parameter, how to write sqlite3 when the column name is string parameter, like this wrong sql: select A.'TEMP_' + STRING_PARAMETER as COLUMN from TABLE_NAME A.
Or how to add a new parameter as 'TEMP_' + STRING_PARAMETER.
You can't use the parameter in from clause. However, with Case statement you can Select dynamic columns based on parameter value.
I have searched online, case is for one column, right? Could you tell me one simple example how to use Case with parameter?
Yes, Case is for one column but you can write multiple case statement for multiple columns. Here is an example.
SELECT C.[EID] AS [EID],
C.[FirstName] AS [FirstName],
C.[Lastname] AS [Lastname],
C.[Salary] AS [Salary],
C.[JoiningDate] AS [JoiningDate],
CASE <Parameters.Dynamic Column>
WHEN 'Email' THEN C.Email
WHEN 'Gender' THEN C.Gender
WHEN 'Department' THEN C.Department
END As [Dynamic Column]
FROM [dbo].[customers] C
Thank you. This method can't solve my problem, cause the dynamic column so many. DO you know how to set a parameter as ('TEMP_' + another parameter)？ Thanks!