July 30, 2002 at 1:13 pm
When I build a UNION query in Enterprise Manager, it tags on the "DERIVEDTBL" after my final UNION. What is the importance of this command? I can find nothing on it in the documentation, and even a search across Google.com & usenet brings up an amazingly small number of hits.
Anyone? I find that if I build a query in Query Analyzer with it or without it, I get the same results.
- Tom
July 30, 2002 at 1:14 pm
I saw this today in Access as well for a subquery.
Don't "build" queries. Write them.
Steve Jones
July 30, 2002 at 1:24 pm
Dont remember seeing it. It's just an alias for the final select, which is really a 'derived table'. I don't use the graphical tools often, but sometimes they are timesavers. Steve is old school you know!
Andy
July 30, 2002 at 3:34 pm
Okay, righto, that makes sense now. If the actual query I wrote was like so...
SELECT TOP 100 PERCENT *
FROM (
SELECT *
FROM Table_1
UNION
SELECT *
FROM Table_2
)
...then the Enterprise Manager would tag on "DERIVEDTBL" at the end. But if I provided my own alias, it used that instead. So...call me Slaphead, it's pretty clear now what it was doing.
And Steve, point well taken. I generally don't "build" them using graphical tools. And as such tools go, I really don't like Enterprise Manager anyway. I was using the term generically -- as where I said "I find that if I build a query in Query Analyzer..."
- Tom
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply