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 |
|
craigwg
Posting Yak Master
154 Posts |
Posted - 2011-04-21 : 16:08:24
|
I get an error message. The derived table runs fine, but I don't understand why this is erroring on the ")".select invoicetotalfrom ( select invoicetotal = max(invoicetotal) from ap..invoices where paymentdate is null group by vendorid ) Craig Greenwood |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-04-21 : 16:11:41
|
| [code]select invoicetotalfrom ( select invoicetotal = max(invoicetotal) from ap..invoices where paymentdate is null group by vendorid ) as table_alias[/code]Derived tables require an alias if they're part of the FROM clause, including a JOIN condition. |
 |
|
|
craigwg
Posting Yak Master
154 Posts |
Posted - 2011-04-21 : 16:37:32
|
| ahhhhh. Thanks. That did it.Craig Greenwood |
 |
|
|
|
|
|