Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

SQL statements in database reference

$
0
0

I have two tables on a sql server. I would like to get the last name of an individual in the personnel table. The id of the person is located in another table  as "operatorId". I have both tables linked as tables in the Pi system Explorer. The record that holds the operatorId is the last record in the table based on creation date field. Looking to do something like this.

 

SELECT tblPersonnel.perLastName

FROM tblPersonnel Join tblPolantDisplay ON tblPersonnel.perId = tblPlantDisplay.plaOperationAuthorityId

WHERE (SELECT TOP 1 FROM tblPlantDisplay ORDER BY plaCreateDate DESC)

 

Is there a way to get the last name as an attribute in an Operator Authority element


Viewing all articles
Browse latest Browse all 1120

Trending Articles