| Author |
Topic |
|
sapator
Constraint Violating Yak Guru
462 Posts |
Posted - 2010-03-11 : 21:59:47
|
| I don't think is possible but let me ask anyway.Can you set (probably with SELECT(@varX ...)2 variables in one select statements.Something like select(@v1,@v2 as (select x,y from tableX)Thanks. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-03-11 : 22:01:30
|
[code]select @v1 = x, @v2 = yfrom tablex[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
sapator
Constraint Violating Yak Guru
462 Posts |
Posted - 2010-03-11 : 23:35:15
|
| Oh damn, have to rewrite my sql sp now ;PThanks. |
 |
|
|
sapator
Constraint Violating Yak Guru
462 Posts |
Posted - 2010-03-11 : 23:45:06
|
| Hi.Sorry i should have specified.I have a problem with distinct. I get Incorrect syntax near the keyword 'distinct'.Can it be used with distinct? |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-03-11 : 23:49:17
|
quote: Originally posted by sapator Hi.Sorry i should have specified.I have a problem with distinct. I get Incorrect syntax near the keyword 'distinct'.Can it be used with distinct?
If your distinct query returns one row, you can go ahead!Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
sapator
Constraint Violating Yak Guru
462 Posts |
Posted - 2010-03-12 : 00:03:04
|
| OK.Also top 1 i guess.Also fixed the sql, i had it select @i =( top 1 ds.maxan ....but it wanted select top 1 @i=(ds.maxan ....Is this correct?Thanks |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-03-12 : 00:06:39
|
quote: Originally posted by sapator OK.Also top 1 i guess.Also fixed the sql, i had it select @i =( top 1 ds.maxan ....but it wanted select top 1 @i=(ds.maxan ....Is this correct?Thanks
Top will fix your issueThe exact syntax isdeclare @i intdeclare @j intselect top 1 @i=dept_id,@j=salary from Employeeselect @i,@j Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
sapator
Constraint Violating Yak Guru
462 Posts |
Posted - 2010-03-12 : 00:12:58
|
| Great.Thanks. |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-03-12 : 00:18:34
|
quote: Originally posted by sapator Great.Thanks.
Welcome Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
|