<p>There doesnt seem to be a relationship between the "collector table" and the "order table" other than the user_id and amount. And as you said, you're having problems there are multiple transactions from the same user for the same amount. So no, this would not be possible without a better relationship to join the tables. Look in to somehow getting a time stamp for the order_id would be the most obvious way to go about resolving this issue. Without providing details as to how exactly you're obtaining this data, no one is really going to be able to help you further.</p>

<p>Also you should really be posting these questions on another StackExchange site, I doubt there are tons of people here with RDBMS/SQL experience.</p>

CC BY-SA 3.0
2014-05-25T09:39:45.270Z
thanks for feedback I moved the topic here http://stackoverflow.com/questions/23804294/identify-bitcoin-transaction-mysql-query-problems
fefe
CC BY-SA 3.0
2014-05-23T04:06:14.780Z
2014-05-23T04:11:21.837Z
2014-05-23T04:11:21.837Z
Matt
<p>How would I identify a transaction taking in consideration the following </p>

<p>I have a user table holding user datas</p>

<pre><code>++ id  | username | btc_recive_address++
----------------------------------------
++  1  | myuser   | 123kahpoiq31328   ++
</code></pre>

<p>order table</p>

<pre><code> ++ order_id  | user_id | amount
 ---------------------------------
 ++ h6765-a1s | 1       | 0.1 BTC
 ---------------------------------
 ++ kzg765-a1 | 1       | 0.1 BTC
</code></pre>

<p>and collector table which retrieves data from bitcoin API( here I identify sender with btc_recive_address)</p>

<pre><code>++ block_chain      | user | amount | timestamp
--------------------------------------------------------------------------------
++ 2d37e5351196...  | 1    | 0.1    | 2014-04-09 16:21:34
--------------------------------------------------------------------------------
++ 123kjhg7231k..   | 1    | 0.1    | 2014-04-08 19:33:56
--------------------------------------------------------------------------------
</code></pre>

<p>and I try to assign transaction to order_id like generating a joined view from order and collector table  but I have problems when the amount and user is the same</p>

CC BY-SA 3.0
2014-05-19T19:11:04.553Z
Can you add the relations between the fields in those table? Or even better the table creation script?
Wizche
CC BY-SA 3.0
2014-05-22T09:57:52.733Z
This question appears to be off-topic because it is about using databases, and not specific to Bitcoin.
Murch
CC BY-SA 3.0
2014-05-22T10:23:18.437Z
@Murch be serious, really? I'm asking about some API stuffs to can build a query. But anyway I will post it somewhere else
fefe
CC BY-SA 3.0
2014-05-22T11:10:05.847Z
I think I had misunderstood your question, and therefore mistakenly voted to close. I am sorry for that, but feel that you are overreacting by being angry and deleting your question. A better course of action would be to discuss such misunderstandings and to improve potentially unclear points in the question. Could you please clarify: What API are you using, is that bitcoind on your own server? Is this all information that you have access to? As you have indicated the combination of user and amount are not unique, it will not be sufficient as a join criteria.
Murch
CC BY-SA 3.0
2014-05-22T11:16:44.333Z
I host the client on the server and I send API requests locally. As a user on order can not send additional information about a transaction I search a way to identify a transactions. At first seems to be ok with the generated BTC recive address but on the flow I met this problem with same amount same user and I don't know if I could use some other things from API to get the desired result
fefe
<transactions><api><mysql>
MySQL view to identify a transaction with retrived API datas
fefe
# MySQL view to identify a transaction with retrived API datas

(Asked by: username_0 on 2014-05-19)

How would I identify a transaction taking in consideration the following

I have a user table holding user datas

```
++ id  | username | btc_recive_address++
----------------------------------------
++  1  | myuser   | 123kahpoiq31328   ++

```

order table

```
 ++ order_id  | user_id | amount
 ---------------------------------
 ++ h6765-a1s | 1       | 0.1 BTC
 ---------------------------------
 ++ kzg765-a1 | 1       | 0.1 BTC

```

and collector table which retrieves data from bitcoin API( here I identify sender with btc\_recive\_address)

```
++ block_chain      | user | amount | timestamp
--------------------------------------------------------------------------------
++ 2d37e5351196...  | 1    | 0.1    | 2014-04-09 16:21:34
--------------------------------------------------------------------------------
++ 123kjhg7231k..   | 1    | 0.1    | 2014-04-08 19:33:56
--------------------------------------------------------------------------------

```

and I try to assign transaction to order\_id like generating a joined view from order and collector table but I have problems when the amount and user is the same

**Tags:** transactions, api, mysql

> **Comments:**
> **username_1**: Can you add the relations between the fields in those table? Or even better the table creation script?  
> **username_2**: This question appears to be off-topic because it is about using databases, and not specific to Bitcoin.  
> **username_0**: @username_2 be serious, really? I'm asking about some API stuffs to can build a query. But anyway I will post it somewhere else  
> **username_2**: I think I had misunderstood your question, and therefore mistakenly voted to close. I am sorry for that, but feel that you are overreacting by being angry and deleting your question. A better course of action would be to discuss such misunderstandings and to improve potentially unclear points in the question. Could you please clarify: What API are you using, is that bitcoind on your own server? Is this all information that you have access to? As you have indicated the combination of user and amount are not unique, it will not be sufficient as a join criteria.  
> **username_0**: I host the client on the server and I send API requests locally. As a user on order can not send additional information about a transaction I search a way to identify a transactions. At first seems to be ok with the generated BTC recive address but on the flow I met this problem with same amount same user and I don't know if I could use some other things from API to get the desired result  

---

## 1 answers

### Answer by username_3 on 2014-05-23. Score: 0

There doesnt seem to be a relationship between the "collector table" and the "order table" other than the user\_id and amount. And as you said, you're having problems there are multiple transactions from the same user for the same amount. So no, this would not be possible without a better relationship to join the tables. Look in to somehow getting a time stamp for the order\_id would be the most obvious way to go about resolving this issue. Without providing details as to how exactly you're obtaining this data, no one is really going to be able to help you further.

Also you should really be posting these questions on another StackExchange site, I doubt there are tons of people here with RDBMS/SQL experience.

> **Comments:**
> **username_0**: thanks for feedback I moved the topic here http://stackoverflow.com/questions/23804294/identify-bitcoin-transaction-mysql-query-problems  

---

