SQL query to exclude values beginning with '1' in a specific column

SQL query to exclude values beginning with '1' in a specific column

Jenny12
Not applicable
840 Views
4 Replies
Message 1 of 5

SQL query to exclude values beginning with '1' in a specific column

Jenny12
Not applicable

[ FlexSim 24.0.3 ]

Hi,

I want to select rows that doesn't not begin with '1' in a specific column, but it seems not to work, and an error message popped up.

" Table.query("SELECT * FROM Test WHERE `A` not like '1%'"); "

How should I do? Thanks in advance!

error-message.png

0418.fsm

0 Likes
Accepted solutions (1)
841 Views
4 Replies
Replies (4)
Message 2 of 5

joerg_vogel_HsH
Mentor
Mentor
Accepted solution
A LIKE '[0,2-9]%'

inverse clause NOT doesn't seem to work with clause of LIKE in FlexSim. I tried it with an regular expression what is allowed and excluded 1 [0,2-9]

Message 3 of 5

moehlmann_fe
Collaborator
Collaborator

It works if the LIKE expression is enclosed in parentheses and the NOT is placed in front of it.

Table.query("SELECT * FROM Test WHERE NOT ( LIKE '1%')")
Message 4 of 5

Jenny12
Not applicable

Hi Joerg,

Thanks a lot for your response, your suggestions are very helpful. However I would like to ask if there is a possibility to support the query of 'not like' in the future?

0 Likes
Message 5 of 5

Jenny12
Not applicable

Thanks a lot for your response.

0 Likes