Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2007-11-29 : 05:58:02
|
| Hi,Can you let me know how to get to tblResult at the buttom from tblDataplease?tblDataBid Ask Import_DateNULL 113.4300 2007-11-29 07:01:00113.3750 NULL 2007-11-29 07:01:00NULL 113.4300 2007-11-29 07:03:00113.3750 NULL 2007-11-29 07:03:00NULL 113.4300 2007-11-29 07:05:00113.3750 NULL 2007-11-29 07:05:00NULL 113.4300 2007-11-29 07:07:00............tblResultBid Ask Import_Date113.3750 113.4300 2007-11-29 07:01:00113.3750 113.4300 2007-11-29 07:03:00113.3750 113.4300 2007-11-29 07:05:00NULL 113.4300 2007-11-29 07:07:00............ |
|
|
PeterNeo
Constraint Violating Yak Guru
357 Posts |
Posted - 2007-11-29 : 06:19:38
|
| Hi,DECLARE @T TABLE (Bid VARCHAR(10), Ask VARCHAR(10), Import_Date DATETIME)INSERT INTO @TSELECT NULL, '113.4300', '2007-11-29 07:01:00' UNION ALLSELECT '113.3750', NULL, '2007-11-29 07:01:00' UNION ALLSELECT NULL, '113.4300', '2007-11-29 07:03:00' UNION ALLSELECT '113.3750', NULL, '2007-11-29 07:03:00' UNION ALLSELECT NULL, '113.4300', '2007-11-29 07:05:00' UNION ALLSELECT '113.3750', NULL, '2007-11-29 07:05:00' UNION ALLSELECT NULL, '113.4300', '2007-11-29 07:07:00'--SELECT * FROM @TSELECT MIN(BID) AS Bid, MIN(ASK) AS Ask, Import_DateFROM @TGROUP BY Import_Date |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-11-29 : 09:37:34
|
What's the difference between PeterNeo's and your query performance wise? Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2007-11-29 : 11:11:07
|
| Solved.Thanks for your help |
 |
|
|
|
|
|
|
|