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 |
|
WoodHouse
Posting Yak Master
211 Posts |
Posted - 2009-08-17 : 04:58:19
|
| I have table like this..A b c d Flag1 10 20 30 02 10 20 40 03 10 20 50 14 10 20 60 05 10 20 70 06 10 20 80 07 10 20 90 1I need these three records so the Delimitor is Flag = 11 10 20 30 02 10 20 40 03 10 20 50 1Please help on this.. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-08-17 : 05:02:26
|
this ?select *from yourtable twhere t.A <= (select min(A) from yourtable x where x.Flag = 1) KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-08-17 : 05:03:23
|
| try like thisdeclare @i intselect @i = min(a) from tablename where flag = 1select * from tablename where a <= @i |
 |
|
|
WoodHouse
Posting Yak Master
211 Posts |
Posted - 2009-08-17 : 05:06:25
|
| HiCan i use like this..select * from tablename where a <= (SELECT MIN(A) FROM tablename where flag = 1) |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-08-17 : 05:07:22
|
| yes |
 |
|
|
WoodHouse
Posting Yak Master
211 Posts |
Posted - 2009-08-17 : 05:07:41
|
| Hi Thanks khtan&Bklrsorry already khtan was posted.......:)- |
 |
|
|
|
|
|