Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

how to count and calculate total percentage for Every product in field?

$
0
0

hi all,

i have two tables as follow:

i have a inner join as follow :

SELECT distinct dbo.Motor_Story.Name, dbo.Goods.kala, dbo.Goods.type, dbo.Goods.id_story FROM dbo.Goods INNER JOIN dbo.Motor_Story ON dbo.Goods.id_story = dbo.Motor_Story.Id

Ihave the followingdataare enteredin my database,

typekalano
Panaconic                        Monitor 1
Sony                             Telvision 2
Samsung                          Phone 3
Vaio                             Computer 4
Panaconic                        Monitor 5
Sony                             Telvision 6
Panaconic                        Phone 7
Panaconic                        Printer 8
Sony                             Computer 9
Panaconic                        Monitor 10
Sony                             Telvision 11
Samsung                          Phone 12
Panaconic                        Printer 13

i want create a view so that, count 'dbo.Goods.type' and calculate total percentage of ' dbo.Goods.type, than other products based on 'dbo.Goods.kala'.

pls hlp me.

best regards.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>