2021年3月30日星期二

SQL Query to perform aggregate and calculate percentage

This is what i am trying to do. I have three tables. Table A, Table B and Table C which i have already created. I need a query that should return me results in table D.

  • the column total_order in Table D is the sum of all b_type and c_type for specific id from Table B and Table C

  • the column percentage is where we are calculating the percentage from column totalR and total_order (14/3*100 = 466.66).

  • The First Three Columns in Table D are from Table A

enter image description here

enter image description here

enter image description here

enter image description here

https://stackoverflow.com/questions/66880695/sql-query-to-perform-aggregate-and-calculate-percentage March 31, 2021 at 10:06AM

没有评论:

发表评论