Hey guys, I am struggling how to write a query to do this.
I have a table that looks like this:
user date_purchased item price
John ‘2011-02-04’ SK2341 34.54
John ‘2012-01-04’ LS2414 94.98
I want to create a new table that looks like this, with the bought before using the bit value:
user item bought_before(T/F).
I want to populate this table with the user, and items and a boolean T/F based on the if user has bought the same item before. Based on the data I have, it should return False for both in the table above but I'm struggling on the statement to do this.
Any ideas?