User Profile

Collapse

Profile Sidebar

Collapse
deepalijm
deepalijm
Last Activity: Dec 20 '07, 06:39 AM
Joined: Dec 19 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • deepalijm
    replied to Need help with a query
    Thanks for the reply. I tried your query and it fails for the following example of data:

    Table1:

    ctid val dt
    7 5 1/1/2006
    7 8 4/1/2006
    7 16 1/1/2007
    9 4 2/24/2006
    9 12 6/6/2006
    9 6 12/12/2006
    9 20 5/3/2007
    10 3 12/12/2007
    10 13 1/1/2007


    I want to return:
    ctid val dt
    7 16 1/1/2007
    9 20 5/3/2007
    10 3 12/12/2007...
    See more | Go to post

    Leave a comment:


  • deepalijm
    started a topic Need help with a query

    Need help with a query

    Hi all,

    I'm trying to
    Select Top 1 value1 from table1
    where CompID = 10
    Order by mydate Desc

    What this does is gives me the value of value1 for the max date.
    Which works very well.

    What I want to achieve is that get the max records for different compids = 7 or 9 or 10 etc. in the table.


    Any ideas?

    Thanks.
    See more | Go to post
No activity results to display
Show More
Working...