question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Kavika F commented

SQL Query to compare column values?

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!



FlexSim 21.0.10
sql querycolumncompare
· 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.

Kavika F avatar image Kavika F ♦ commented ·

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 0 ·

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Jason Lightfoot commented

count_query.fsm

Table mytable = Table.query("SELECT COUNT([Col 1]) FROM GlobalTable1 WHERE [Col 1] = [Col 2]");
mytable.cloneTo(Table("dump"));

count-query.fsm (25.1 KiB)
· 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 ·

Or

SELECT SUM([RoomName]=[AllocatedRoom]) FROM GlobalTable1
1 Like 1 ·