SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: MySQL query

  1. #1
    SitePoint Zealot
    Join Date
    May 2002
    Location
    Brandon, MS
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL query

    I have a simple database for a non profit that collects used sports equipment. I need a MySQL query I can plug into phpMyAdmin that does the following-

    Finds a specific ITEM (i.e. cleats) and CONDITION (i.e. used) then multiplies the QTY of each ITEM by its UNIT VALUE. Then I need to add all the results together for one total. Any help greatly appreciated!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by kenbusby View Post
    Finds a specific ITEM (i.e. cleats) and CONDITION (i.e. used) then multiplies the QTY of each ITEM by its UNIT VALUE.
    the parts in red are contradictory

    unless there are multiple items that all have a "cleats" type

    best would be if you could do a SHOW CREATE TABLE for the table in question
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Zealot
    Join Date
    May 2002
    Location
    Brandon, MS
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are multiple lines that have "cleats" as the item. I need to multiply the number of cleats by the unit cost. Once I do that for each line I need to add all the results together.

    Thanks

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    could you please do a SHOW CREATE TABLE for the table in question
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •