Data leads and DBA's rely on SQL to query data. Data analysts unversed with LRS and/or versioning may struggle with query methods.
Note that there are 2 technical concepts in play:
The design considerations are discussed in the blog SQL Views and Branch Versioning
The following SQL code logic may be used to build queries off branch-versioned LRS datasets:
SELECT Name, Type -- Attributes
FROM GIS.ROAD_XX t -- Table
WHERE t.gdb_is_delete = 0 -- Start branch versioning logic
AND t.gdb_branch_id = 0
AND t.gdb_archive_oid = ( SELECT MAX(gdb_archive_oid)
FROM <table> bt
WHERE bt.globalID = t.globalID
AND bt.gdb_branch_id = 0 )
-- End branch versioning logic
-- Optional LRS filtering
AND TODATE IS NULL -- Current LRS records
AND LOCATIONERROR = ‘NO ERROR’ -- Event records with no LRS errors
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.