Results 1 to 2 of 2

Thread: Update Table on Real Time, SQL query req.

  1. #1
    Join Date
    Apr 2012
    Posts
    1

    Update Table on Real Time, SQL query req.

    Hi All,

    Here is the scenario, I have a table called "Table1" which updates on real time basis, i want to copy the data from Table1 to my newly created Table2 which is having 2 columns, Number and Count.
    While copying the data from Table1 to Table2 if it founds matches record in "Number" column then it increments it to 2 in Count column.

    Need query for above mentioned scenario.....any help will be remembers in good wordings.....

  2. #2
    Join Date
    Jan 2006
    Posts
    605

    Re: Update Table on Real Time, SQL query req.

    You can check the below code that makes a complete EOD table from Realtime table (tested on MSSQL 2008, but should work on 2005 as well).

    Code:
    SELECT Symbol, Date, Value FROM
    (
         SELECT *, ROW_NUMBER() OVER(
             PARTITION BY symbol, DATEPART(yy, date), DATEPART(y, date)
              ORDER BY date desc) AS ord
         FROM Realtime
     ) AS t
     WHERE ord = 1

Similar Threads

  1. SQL Query For Copy records from one table to another
    By Bellamy in forum Software Development
    Replies: 4
    Last Post: 23-05-2010, 12:36 AM
  2. LIKE query on table with three million lines
    By MKAIF in forum Software Development
    Replies: 3
    Last Post: 24-11-2009, 04:34 PM
  3. Different ways of using sql query for adding values in the table
    By REDBULL in forum Software Development
    Replies: 3
    Last Post: 13-11-2009, 08:58 AM
  4. How to Create view based on table-join query
    By Preetish in forum Windows Software
    Replies: 3
    Last Post: 12-08-2009, 01:44 PM

Tags for this Thread

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
  •  
Page generated in 1,713,416,079.34928 seconds with 17 queries