#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Gathering Data from multiple tables


    Hello

    I have a table that is produced every day with the same data within the tables.

    I'm try to collate some data from each table.

    Example table names are
    trendvalues_<2013><05><01>
    trendvalues_<2013><05><02>
    trendvalues_<2013><05><03>

    and so on

    With in the table I need need the following

    UTCTimeStamp
    Value

    where the VarID = 1136

    Thanks

    Robert
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,026
    Rep Power
    4210
    Code:
    SELECT UTCTimeStamp
         , Value
      FROM `trendvalues_<2013><05><01>`
     WHERE VarID = 1136
    UNION ALL
    SELECT UTCTimeStamp
         , Value
      FROM `trendvalues_<2013><05><02>`
     WHERE VarID = 1136
    UNION ALL
    SELECT UTCTimeStamp
         , Value
      FROM `trendvalues_<2013><05><03>`
     WHERE VarID = 1136
    r937.com | rudy.ca
    please visit Simply SQL and buy my book
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Thanks


    r937

    Thanks

    Regards

    Robert

IMN logo majestic logo threadwatch logo seochat tools logo