Questions tagged [multiple-occurrence]
17 questions
-1
votes
1 answer
How to create a variable that counts the number of occurrences of another variable (1 for first occurrence, 2 for second etc)
I have this data:
#id time
#1 1
#1 2
#2 1
#2 2
#2 1
#2 2
#3 1
#3 2
And I want to create a variable that looks at the id and time combination and puts a 1 the first time it sees it and 2 the second time it sees it. So this occurrence…

Victor Nielsen
- 443
- 2
- 14
-2
votes
2 answers
Want to select all rows except first row of every customer_id
I have the table customer which conatins data of customer in multiple months.
My task is to show the repeated customer with there details in which i need the fetch the rows from second occurrences but the my query is fetching the first occurrence…

astha jain
- 1
- 1