SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    toronto
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql help, query hangs

    SELECT a.id,a.dateid,a.ticker,
    case
    when a.close-(select b.close
    from hist b
    where a.ticker=b.ticker
    and b.dateid=a.dateid-1
    ) > 0
    then a.close-(select c.close
    from hist c
    where a.ticker=c.ticker
    and c.dateid=a.dateid-1
    )

    else '0.0'
    end
    from hist a
    where a.dateid > 3568;
    ScorecardMarketing.ca

    Sales under par? Try Scorecard Marketing!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,017
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    indexes?
    r937.com | rudy.ca | 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
  •