question

Jouky D avatar image
0 Likes"
Jouky D asked Jason Lightfoot commented

SQL Query: How can I call a column called "Good Percentage [%]"?

Hello everyone,

I am trying to use SQL Table.query statement to order the table by the Good Percentage [%] column. However, I tried to use:

[Good Percentage [%]] and ['Good Percentage [%]']

But FlexSim closes. Could it be some characters as [] or % forbidden for SQL Queries?

And another quick question, how do we use the SQL Aggregation functions? If we want the Minimum value of a column for example? (without ordering by the table query). How do we use the SQL Aggregation functions from flexsim docs:

  • SUM()
  • AVG()
  • COUNT()
  • MIN()
  • MAX()
  • STD()
  • VAR()
  • ARRAY_AGG()

    Thank you!
FlexSim 23.1.3
sqlsql queriessql query
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Arun Kr avatar image
0 Likes"
Arun Kr answered Jason Lightfoot commented

The problem here is the square brackets [ ]. You can use Good Percentage % as the column header. From the manual "The [ ] syntax is an SQL delimiter that allows you to define column names with spaces in them". In this case, you are trying to put a delimiter as the column header, which could be the reason that Flexsim is throwing errors or getting crashed.

To avoid the exception or crashing use Good Percentage % as the column header. It will work.

Furthermore, visit www.w3schools.com/sql/ for understanding the aggregate functionalities.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·
In particular look for MySQL syntax - with which FlexQL is most aligned.
0 Likes 0 ·