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 |
|
djcraig
Starting Member
1 Post |
Posted - 2009-07-15 : 16:13:14
|
| I'm running a simpe query (at least I thought it was simple):select max(vote_date) from (select ca.vote_date from concept_approvers ca unionselect ia.vote_date from investment_approvers ia)I 'm getting the following error:Msg 102, Level 15, State 1, Line 5Incorrect syntax near ')'.Any help is appreciated |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-07-15 : 16:32:01
|
select max(vote_date) from (select ca.vote_date from concept_approvers ca unionselect ia.vote_date from investment_approvers ia) as dtYou have to give an alias for a derived table. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-16 : 14:07:45
|
| since you're any ways taking only max value, it might be better to use union all inside as you dont need to look for distinct values inside |
 |
|
|
|
|
|