I need to link Purchase Requisition (PR) lines to Purchase Order (PO) lines using SQL in Dynamics 365 F&O.

public PurchLine purchLine()
{
PurchLine purchLine;
if (this.PurchId && this.LineRefId)
{
select firstonly purchLine
where purchLine.PurchId == this.PurchId &&
purchLine.PurchReqLineRefId == this.LineRefId &&
!purchLine.IsDeleted;
}
return purchLine;
}