<div dir="ltr">Hello, I'm stuck on how to grab the user that made a change from an auditor table? How do I look for the first occurrence of a new value, and then grab the previous rows audit_user and audit_date? <div><br></div><div>The way that I understand it, the auditor tables store the user that made a change, and then the old values that were in the audited table before the change. So the audit_user and audit_date are not for the data in the same row, but are for the next newest row.<div><br></div><div>Do I need a window function so I can look at previous rows? Or is there a much simpler way to do it? Maybe a window with lag()/lead() to shift the audit_user and audit_date to the next row?</div><div><br></div><div>I'm working on seeing if I can pull out barcode creation info, to fill in actor.card creator and create_date for LP#1705332, which adds those fields into actor.card.</div><div><br></div><div>Thanks for any hints.</div><div>Josh</div><div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><table style="padding:0px;margin:10px 0;border:none"><tbody><tr><td style="vertical-align:middle;padding:0 7px 0 0"><img alt="Company logo" height="100" src="https://storage.googleapis.com/signaturesatori/customer-C039u5c5y/images/GJnfy.png" width="100"></td><td style="border-left:3px solid #e8e8e8;padding:7px 0 0 10px">
<div style="font-family:'arial','helvetica',sans-serif;font-size:14px;line-height:17px;font-weight:bold;color:rgb(238,142,22)"><span style="font-size:16px"><strong>Josh Stompro</strong></span></div>
<div style="font-family:'arial','helvetica',sans-serif;font-size:12px;line-height:14px;font-weight:normal;color:rgb(0,0,0);margin-bottom:10px"><span style="font-size:13px"><strong><em>IT Director</em><br>
<a href="mailto:stomproj@gsuite.larl.org" style="text-decoration:none;color:rgb(27,70,153)" target="_blank">stomproj@gsuite.larl.org</a></strong><br>
<strong>218-233-3757 ext. 139</strong> </span><span style="font-size:13px"><span style="color:rgb(1,186,239)">| </span><strong>Mobile: 218-790-2110</strong></span><br>
<br>
<span style="font-size:13px"><strong><span style="color:#1b4698">Lake Agassiz Regional Library | </span></strong></span><span style="font-size:13px"><strong><a href="http://www.larl.org" style="text-decoration:none;color:rgb(27,70,153)" target="_blank">www.larl.org</a></strong><br>
118 5th ST S<br>Moorhead MN 56560<br>
<span style="color:#01baef"><em><strong>Celebrating 60 Years of Service in 2021!</strong></em></span></span></div>
</td></tr></tbody></table>
</div></div></div></div></div></div>