SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    create view...a simple question

    hi there

    I have this table
    CREATE TABLE `sample`.`user_production` (
    `user_id` INT NOT NULL ,
    `1hour` INT NOT NULL ,
    `2hour` INT NOT NULL ,
    `3hour` INT NOT NULL ,
    `4hour` INT NOT NULL ,
    `day` DATE NOT NULL,
    INDEX ( `user_id` )
    )

    so...every user work and makes a number of products in each hour.
    I need to create a view which keeps(sum) the production per hour of all the users grouped by day.

  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)
    before you create the view, can you create a query that does what you want?
    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
  •