User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 392,068 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,310 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 1594 | Replies: 0
Reply
Join Date: Aug 2005
Posts: 1
Reputation: HasanaMonique is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
HasanaMonique HasanaMonique is offline Offline
Newbie Poster

Creating New Columns From Calucations

  #1  
Aug 15th, 2005
Hi,

I am VERY new to SQL and I do not know if I am word this question correctly, so forgive me.

I would like to create a new table that does calculations on some of the same fields.
• IPA number (from the IPA_Num field)
• Total number of Rx's (sum of rx field )
• Total Paid( sum of amt_paid field)
• Total generic paid (If the field drugs = 1 then sum the amt_paid field)
• Percent generic (If the field drugs = 1 then sum and divide by the sum of the field rx)
• Percent formulary (if the formulary field = A then sum and divide by the rx field)
• Cost difference ( Average amount paid per brand Rx - average amount paid per generic Rx )

Any help is greatly appreciated.

Blessing to all

Yvonne
:eek:
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MySQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 11:53 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC