Click here to Skip to main content
15,886,422 members
Home / Discussions / Database
   

Database

 
QuestionRe: Help me understand this unusual query... Pin
Rafferty Uy28-Dec-09 15:46
Rafferty Uy28-Dec-09 15:46 
AnswerRe: Help me understand this unusual query... Pin
Luc Pattyn28-Dec-09 15:55
sitebuilderLuc Pattyn28-Dec-09 15:55 
GeneralRe: Help me understand this unusual query... Pin
Rafferty Uy28-Dec-09 16:00
Rafferty Uy28-Dec-09 16:00 
GeneralRe: Help me understand this unusual query... Pin
Luc Pattyn28-Dec-09 16:02
sitebuilderLuc Pattyn28-Dec-09 16:02 
AnswerRe: Help me understand this unusual query... Pin
WoutL28-Dec-09 21:24
WoutL28-Dec-09 21:24 
GeneralRe: Help me understand this unusual query... Pin
Rafferty Uy29-Dec-09 15:34
Rafferty Uy29-Dec-09 15:34 
AnswerRe: Help me understand this unusual query... Pin
Member 450194029-Dec-09 5:47
Member 450194029-Dec-09 5:47 
QuestionNeed help with constructing one query statement [modified] Pin
James Shao27-Dec-09 3:43
James Shao27-Dec-09 3:43 
Hi, I am trying to construct a query statement that allows me to retrieve what’s known as “Bullish Divergence” in stock investing signals. It occurs when stock price reaches to a new high level, surpassing a previous price peak, while a certain strength indicator on the same date fails to surpass the strength indicator of the previous peak. This would suggest the stock price is over-valued.

The logic is to first find all the stocks whose prices have reached new highs on 11/24/2009 within the past 10 days, and if their RSI figures fail to be greater than the RSI figures of the previous peaks, then we have a bullish divergence. Smile | :)

I currently have the following query statement, which returns an error message saying “Subquery returned more than 1 value and cannot be used when subquery follows <, >, >=, <=, =”. Could anyone please help me with this? Dead | X| I would be very thankful as I’ve spent hours trying to get it to work. Thanks!!
SQL
SELECT Date, Ticker, Price, RSI
FROM Table
WHERE (Price =
(SELECT MAX(Price) AS Expr1
FROM Table AS t2
WHERE (Table.Ticker = Ticker) AND (Date BETWEEN DATEADD(day, - 10, '11/24/2009')
  AND '11/24/2009'))) AND (Date = '11/24/2009') AND 
(RSI <
(SELECT RSI
FROM Table AS t3
WHERE (Price =
(SELECT MAX(Price) AS Expr1
FROM Table AS t4
WHERE (t3.Ticker = Ticker) AND (Date BETWEEN DATEADD(day, 
-10, '11/23/2009') AND '11/23/2009')))))


modified on Tuesday, December 29, 2009 8:38 PM

AnswerRe: Need help with constructing one query statement Pin
Blue_Boy27-Dec-09 10:21
Blue_Boy27-Dec-09 10:21 
GeneralRe: Need help with constructing one query statement Pin
James Shao27-Dec-09 18:38
James Shao27-Dec-09 18:38 
AnswerCan anyone please help? Pin
James Shao28-Dec-09 12:13
James Shao28-Dec-09 12:13 
QuestionProblem installing MS SQL 2008 Express Pin
AndyASPVB26-Dec-09 22:26
AndyASPVB26-Dec-09 22:26 
AnswerRe: Problem installing MS SQL 2008 Express Pin
Roger Wright26-Dec-09 23:18
professionalRoger Wright26-Dec-09 23:18 
GeneralRe: Problem installing MS SQL 2008 Express Pin
AndyASPVB28-Dec-09 13:07
AndyASPVB28-Dec-09 13:07 
GeneralRe: Problem installing MS SQL 2008 Express Pin
Roger Wright28-Dec-09 15:51
professionalRoger Wright28-Dec-09 15:51 
QuestionGIS Data Archive Pin
KORCARI25-Dec-09 22:44
KORCARI25-Dec-09 22:44 
AnswerRe: GIS Data Archive Pin
loyal ginger26-Dec-09 5:52
loyal ginger26-Dec-09 5:52 
GeneralRe: GIS Data Archive Pin
KORCARI26-Dec-09 5:58
KORCARI26-Dec-09 5:58 
GeneralRe: GIS Data Archive Pin
Roger Wright26-Dec-09 23:30
professionalRoger Wright26-Dec-09 23:30 
QuestionHow to create FileName or Folder name with space ? Pin
Golden Jing24-Dec-09 22:27
Golden Jing24-Dec-09 22:27 
AnswerRe: How to create FileName or Folder name with space ? [modified] Pin
Andy_L_J25-Dec-09 8:53
Andy_L_J25-Dec-09 8:53 
GeneralRe: How to create FileName or Folder name with space ? Pin
Golden Jing26-Dec-09 0:06
Golden Jing26-Dec-09 0:06 
GeneralRe: How to create FileName or Folder name with space ? Pin
Tim Carmichael26-Dec-09 1:23
Tim Carmichael26-Dec-09 1:23 
GeneralRe: How to create FileName or Folder name with space ? Pin
Golden Jing26-Dec-09 23:38
Golden Jing26-Dec-09 23:38 
QuestionRe: How to create FileName or Folder name with space ? Pin
Md. Marufuzzaman27-Dec-09 2:57
professionalMd. Marufuzzaman27-Dec-09 2:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.