user3940: How can I query the last UTxO from an address on PostgreSQL (I used cardano-db-sync) like I would do using cardano-cli:

cardano-cli query utxo --address addr_test1vpm4uhupwxc4jjea6c6s5p0t80znlfr03xj4ewygnjtxd3cyjdv8x --testnet-magic 1097911063

I also want to know more information regarding this transaction like who sent, etc.
Thank you very much.

user382: To get the basic utxo you would get from query utxo, you want a join from utxo_view to tx table.
SELECT * FROM utxo_view INNER JOIN tx ON tx.id = utxo_view.tx_id WHERE address = 'addr1...'
To get the list of txins sending the tx, you need to join that to tx_in and then rejoin that to the tx_out table and it will return a row for every output that's being used as an input, but usually at this point of complexity with SQL queries I start to throw for loops into my code.

3940: <p>How can I query the last UTxO from an address on PostgreSQL (I used <code>cardano-db-sync</code>) like I would do using cardano-cli:</p>
<blockquote>
<p>cardano-cli query utxo --address addr_test1vpm4uhupwxc4jjea6c6s5p0t80znlfr03xj4ewygnjtxd3cyjdv8x --testnet-magic 1097911063</p>
</blockquote>
<p>I also want to know more information regarding this transaction like who sent, etc.</p>
<p>Thank you very much.</p>
 382: <p>To get the basic utxo you would get from <code>query utxo</code>, you want a join from utxo_view to tx table.</p>
<p><code>SELECT * FROM utxo_view INNER JOIN tx ON tx.id = utxo_view.tx_id WHERE address = 'addr1...'</code></p>
<p>To get the list of txins sending the tx, you need to join that to tx_in and then rejoin that to the tx_out table and it will return a row for every output that's being used as an input, but usually at this point of complexity with SQL queries I start to throw for loops into my code.</p>
