<p>Efficient manner is join.</p>
<pre><code>select block.id as block_identifier,* from tx left join block on block.id=tx.block_index where tx.hash='\x{hash}';
</code></pre>
<p>Make sure you pay attention to not mixing ID fields.</p>
<p>Some variables not accurately named, a quick check should help you though. You'll need to login to your postgres instance and connect using \c cexplorer</p>
<p>Then type \dt+ to get tables. \d+ {tablename}</p>

CC BY-SA 4.0
2022-12-02T06:19:17.087Z
The schema docs (autogenerated) are at https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/schema.md .
Erik de Castro Lopo
CC BY-SA 4.0
2021-09-25T13:50:50.940Z
2022-12-02T06:18:16.450Z
2022-12-02T06:18:16.450Z
Patrick Sturm
<p>Can someone help out with how can i query the transaction details from a block using cardano db sync table? I actually need fields like epoch no, date of transaction, stake address, pool and the amount of the given transaction? I was trying it from the delegation table, but i am having problem with finding the epoch no and if the amount for a given stake address is input or an output(-ve for outgoing and +ve for incoming amount for a given stake address).</p>

<cardano-db-sync>
Query all the transaction details from a given block using cardano db sync
# Query all the transaction details from a given block using cardano db sync

(Asked by: username_0 on 2021-09-25)

Can someone help out with how can i query the transaction details from a block using cardano db sync table? I actually need fields like epoch no, date of transaction, stake address, pool and the amount of the given transaction? I was trying it from the delegation table, but i am having problem with finding the epoch no and if the amount for a given stake address is input or an output(-ve for outgoing and +ve for incoming amount for a given stake address).

**Tags:** cardano-db-sync

---

## 1 answers

### Answer by username_1 on 2021-09-25. Score: 2

Efficient manner is join.
select block.id as block_identifier,* from tx left join block on block.id=tx.block_index where tx.hash='\x{hash}';

Make sure you pay attention to not mixing ID fields.
Some variables not accurately named, a quick check should help you though. You'll need to login to your postgres instance and connect using \c cexplorer
Then type \dt+ to get tables. \d+ {tablename}

> **Comments:**
> **username_2**: The schema docs (autogenerated) are at https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/schema.md .  

---

