I want to get first,second and n th occurent of value in sql database? I would like to count Place  occurrences of values for attribute in each row:

id  | attribute      |Occurence

1  | ICT              1   |the first time of ICT
2  | ENGINEERING      1   |the first time of ENGINEERING      
3  | ICT              2   |the second time of ICT
4  | ENGINEERING      2   |the second time of  ENGINEERING          
5  | ENGINEERING      3   |the Third time of  ENGINEERING
You can use ROW_NUMBER to count it. Here is more about this

CREATE TABLE Table1
    ([id] int, [attribute] varchar(11))
;

INSERT INTO Table1
    ([id], [attribute])
VALUES
    (1, 'ICT'),
    (2, 'ENGINEERING'),
    (3, 'ICT'),
    (4, 'ENGINEERING'),
    (5, 'ENGINEERING')
;


SELECT
  id,attribute
  ,ROW_NUMBER()OVER(PARTITION BY Attribute ORDER BY id) as Occurence
FROM
  Table1
ORDER BY id;


output:

id  attribute   Occurence
1   ICT         1
2   ENGINEERING 1
3   ICT         2
4   ENGINEERING 2
5   ENGINEERING 3


dbfiddle here