Hi
I have a query as follows
select * from
( select CompanyID , TickerSymbol , CompanyName,
dbo.FormatNumbe r(LatestClosing Price,2) as 'CurrentPrice' from
backscreeningda ta3
where dailydate= '12/31/04' and (LatestClosingP rice>100) ) as m0,
( select CompanyID , TickerSymbol , CompanyName,
dbo.FormatNumbe r(LatestClosing Price,2) as 'CurrentPrice' from
backscreeningda ta3 where dailydate= '12/31/04' and
(LatestClosingP rice>150) ) as m1
where 1=1 and m0.CompanyId=m1 .CompanyId
Order By m0.Tickersymbol asc
And the resultset is follows
ALX ALEXANDER'S INC 215 215
BRK.A BERKSHIRE HATHAWAY -CL A 87900 87900
CME CHICAGO MERC EXCH HLDGS 228.7 228.7
FFH FAIRFAX FINANCIAL HLDG 168.5 168.5
GOOG GOOGLE INC 192.79 192.79
GREY GREY GLOBAL GROUP INC 1099.99 1099.99
MKL MARKEL CORP 364 364
NVR NVR INC 769.4 769.4
NWLIA NATIONAL WESTERN LIFE 166.5 166.5
SEB SEABOARD CORP 998 998
STU STUDENT LOAN CORP 184 184
WPO WASHINGTON POST -CL B 983.02 983.02
WSC WESCO FINANCIAL CORP 393 393
Y ALLEGHANY CORP 285.25 285.25
ie i get the common stocks that exits in both the criteria
but my requirement is i want all the stocks that pass each criteria
I have a query as follows
select * from
( select CompanyID , TickerSymbol , CompanyName,
dbo.FormatNumbe r(LatestClosing Price,2) as 'CurrentPrice' from
backscreeningda ta3
where dailydate= '12/31/04' and (LatestClosingP rice>100) ) as m0,
( select CompanyID , TickerSymbol , CompanyName,
dbo.FormatNumbe r(LatestClosing Price,2) as 'CurrentPrice' from
backscreeningda ta3 where dailydate= '12/31/04' and
(LatestClosingP rice>150) ) as m1
where 1=1 and m0.CompanyId=m1 .CompanyId
Order By m0.Tickersymbol asc
And the resultset is follows
ALX ALEXANDER'S INC 215 215
BRK.A BERKSHIRE HATHAWAY -CL A 87900 87900
CME CHICAGO MERC EXCH HLDGS 228.7 228.7
FFH FAIRFAX FINANCIAL HLDG 168.5 168.5
GOOG GOOGLE INC 192.79 192.79
GREY GREY GLOBAL GROUP INC 1099.99 1099.99
MKL MARKEL CORP 364 364
NVR NVR INC 769.4 769.4
NWLIA NATIONAL WESTERN LIFE 166.5 166.5
SEB SEABOARD CORP 998 998
STU STUDENT LOAN CORP 184 184
WPO WASHINGTON POST -CL B 983.02 983.02
WSC WESCO FINANCIAL CORP 393 393
Y ALLEGHANY CORP 285.25 285.25
ie i get the common stocks that exits in both the criteria
but my requirement is i want all the stocks that pass each criteria
Comment