SQL Query to compare column values?

SQL Query to compare column values?

rajankur6494
Advocate Advocate
7 Views
3 Replies
Message 1 of 4

SQL Query to compare column values?

rajankur6494
Advocate
Advocate

[ FlexSim 21.0.10 ]

Hi Team,

I have global table data as given below:

RoomName AllocatedRoom

ABC DEF

ABC ABC

DEF DEF

DEF ABC

ABC ABC

DEF DEF

How can I count values using SQL query where RoomName==AllocatedRoom?

Thank you!



0 Likes
Accepted solutions (1)
8 Views
3 Replies
Replies (3)
Message 2 of 4

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

count_query.fsm

Table mytable = Table.query("SELECT COUNT([Col 1]) FROM GlobalTable1 WHERE [Col 1] = [Col 2]");
mytable.cloneTo(Table("dump"));
0 Likes
Message 3 of 4

jason_lightfootVL7B4
Autodesk
Autodesk

Or

SELECT SUM([RoomName]=[AllocatedRoom]) FROM GlobalTable1
Message 4 of 4

kavika_faleumu
Autodesk
Autodesk

Hi @Ankur A3, was Joerg Vogel's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes