Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

Close
Important Announcement: WELCOME to the new Schneider Electric Community! Community is now no longer part of Exchange, and is now rebranded under se.com. If you have any bookmarks and links saved, we request you to update them to ensure that you continue accessing our community from this new location. For any issues that you might encounter as part of this change, please reach out to SchneiderCommunity.Support@se.com, and the team will help to get your issues resolved.
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
82514members
350118posts

Wrong result in Machine SCADA Expert SQL query.

Industry Automation and Control Forum

This forum is addressing industrial automation design & engineering, operations, asset performance, cyber security and digital transformation for Plants & Machines.

Solved
jthyge
Ensign
Ensign

Wrong result in Machine SCADA Expert SQL query.

Hello

 

I am making a SQL query to a MySQL database. 

 

When I run the query in MySQL, I get the right result. 

 

When I send the SQL statement from Machine SCADA Expert, the result is not right. 
It is like the lase WHERE clause is ignored. 

 

This is the Query: 

SELECT SUM(Minute_In_State) From
   (SELECT
   Time_Stamp,
   State,
   TIMESTAMPDIFF(SECOND, LAG(Time_Stamp) OVER(ORDER BY Time_Stamp), Time_Stamp)
   AS Minute_In_State
   FROM db.xyz_1_state
   ORDER BY Time_Stamp) AS T
Where State = 1;

 

Any suggestion why the result is different, when sent from Machine SCADA Expert?


Accepted Solutions
BevanWeiss
Spock
Spock
0 Likes
1
905

Re: Wrong result in Machine SCADA Expert SQL query.

This is the Geo SCADA Expert forum.  So you're not that likely to get great results looking for Machine SCADA Expert info here (since they are different products).

 

I think you wanted this forum instead: https://community.exchange.se.com/t5/Industry-Automation-and-Control/bd-p/industry-automation-contro...


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..

See Answer In Context

2 Replies 2
BevanWeiss
Spock
Spock
0 Likes
1
906

Re: Wrong result in Machine SCADA Expert SQL query.

This is the Geo SCADA Expert forum.  So you're not that likely to get great results looking for Machine SCADA Expert info here (since they are different products).

 

I think you wanted this forum instead: https://community.exchange.se.com/t5/Industry-Automation-and-Control/bd-p/industry-automation-contro...


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
jthyge
Ensign
Ensign
0 Likes
0
900

Re: Wrong result in Machine SCADA Expert SQL query.

Oh Ok. 

Thanks!!