| Author |
Topic |
|
damuchinni
Starting Member
29 Posts |
Posted - 2007-05-22 : 06:14:36
|
| Hi,is there any laternative to select particular record without using where clause |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-22 : 06:16:41
|
Yeah. Use cursor and fetch record by record until the record you want. Seriously, What are you trying to do here ? KH |
 |
|
|
PeterNeo
Constraint Violating Yak Guru
357 Posts |
Posted - 2007-05-22 : 06:35:33
|
| Try something like, not sure they r acceptableselect name, id from sysobjects group by name, id, typehaving type = 'p' -- here we need to specify all the cols in group byselect distinct case when type = 'p' then name else null endfrom sysobjectsand lastly self join |
 |
|
|
damuchinni
Starting Member
29 Posts |
Posted - 2007-05-22 : 06:49:31
|
| Hi PeterNeo,Thank u so much. can u plzz look into the post that i posted "need to calculate number of years".regards damodar |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-22 : 07:05:55
|
quote: Originally posted by damuchinni Hi,is there any laternative to select particular record without using where clause
Is it so difficult to use WHERE clause?Can you explain what you are trying to do?MadhivananFailing to plan is Planning to fail |
 |
|
|
pbguy
Constraint Violating Yak Guru
319 Posts |
Posted - 2007-05-22 : 07:24:40
|
| May be faced this question in interview.....:-) |
 |
|
|
damuchinni
Starting Member
29 Posts |
Posted - 2007-05-22 : 07:49:54
|
| Hi madhivanan,just look below queryselect top 1 * from emp where emp_id=1that query is okbt if at all i want a particular record of emp_id=1 . if each emp_id contains multiple recordsthen how can i proceed |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-22 : 08:01:07
|
| See if this helps: [url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=80669[/url][url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=80073[/url]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|