I’m working on a customers database and I want to get all data for their second purchase (for all of our customer weather they have 2 or more purchases). For example: I want to display the second order which is: I’m facing some difficulties in finding the right logic, any idea how I can achieve my end goal? 🙂 *Note:
Tag: analysis
How to select students with marks in all three subjects less then 100
I came across this question Here is my response to it, I just started myself learning SQL recently. Select a.roll_number , a.name , b.roll_number from student_information a join …
Partition by with condition statement
I have data of products that are sold by various shops. For some shops they are sold with discount mapped by PROMO_FLG. I would like to display two COUNT PARTITION columns. First displays all shops that thave this product (which is done) COUNT(DISTINCT STORE) OVER (PARTITION ITEM) would give is 10 Second one – which I seek – counts only