question

Mark S2 avatar image
0 Likes"
Mark S2 asked Jason Lightfoot commented

Combining Two Calculated Tables via SQL

Hello,

I am trying to combine two calculated tables into one via SQL, however my model crashes when I try.

The two tables are:

CalculatedWaitRoomArrivals

CalculatedEHSArrivals


and turning into:

Join Patient Flows Triage Wait Times

Here is the model just before the crash happens:
New Generic Model for Triage_1.fsm

And here is a previous working version:

New Generic Model for Triage.fsm


Thanks!

Mark


FlexSim 22.2.0
calculated tablesql queries
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

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

Does this work as expected?

new-generic-model-for-triage_jl.fsm


· 2
5 |100000

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

Mark S2 avatar image Mark S2 commented ·

Ugh, yes. Thank you. So simple a fix, but I would have never figured it out. It still throws an error:

syntax error, unexpected select, expecting ')'

But it works so...

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Mark S2 commented ·

Right, we can avoid that by removing the first set of parentheses:

SELECT * FROM CalculatedWaitRoomArrivals
UNION ALL  
(SELECT * FROM CalculatedEHSArrivals)
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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