I’ve not kept up to date each week with updates and I see there has been a fair amount of updates to queries, and the database manager.
Is there now a possibility to combine two DB Queries into a single output that’s useable in a repeat? If there is (awesome) what would be the best approach, or link to documentation I can study?
Thanks @Sorry_Duh - I thought of the join function, but unfortunately there isn’t a ‘matching’ id number between the collections we wish to join, while the info is fairly similar, the items are not aligned in anyway so I was wondering if another feature has been developed that could solve that.
So what we have is a transaction history for a single web3 wallet address.
Their transaction history is stored in two different tables. The items they are buying, are entirely different from each other so there is no common id, or common link between the two.
I want to output the transaction history of both tables into one output I can then show on the F/E.
Example:
TXN Table 1:
id
item_name
description
price
txn
item_id (linking to that specific purchases table)
TXN Table 2
id
collection_name
description
price
txn
item_id (linking to that specific purchases table)
the item_id is not a common link between the two, as they themselves are separate tables with unique information.
So the goal here would be to have a single output:
id
name (which would be either item_name or collection_name)
description
price
item_type (e.g. type one, or type two)
date etc.
Ok but then how do you know which record from table 1 should be joined with which in table 2?
Or do you just want to list all records from table 1 followed by all records from table 2 in a single output?
SELECT id, item_name AS name, description, price, txn, item_id FROM Table1
UNION
SELECT id, collection_name AS name, description, price, txn, item_id FROM Table2