Rowdy King
Rowdy King

Reputation: 3

Hello everyone Sql Insert with same id but different values in another column?

I need the requirements of inserting multiple rows of same ID

My Table Data:

Steam_id Skin_name
steam_id 1 skin_name1
steam_id 1 skin_name2
steam_id 1 skin_name3

steam_id 2 skin_name1
steam_id 2 skin_name2
steam_id 2 skin_name3

Required Output Should be,

Steam_id Skin_name
steam_id 1 3 ( total number of skin )
steam_id 2 3 ( total number of skin )

Please help me to achieve this output.

Thanks.

Upvotes: 0

Views: 192

Answers (1)

Jason Pan
Jason Pan

Reputation: 21873

Try to use below script.

SELECT Steam_id,COUNT(*) Skin_name FROM Table_case GROUP BY Steam_id

enter image description here

Upvotes: 1

Related Questions