What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 149 Stack Exchange communities.

I think it would be useful if we could join across databases in the data-explorer.

For example, I'd like to query up a list of questions that I had a hand in migrating away from SO, and see what percentage of them were subsequently closed or re-migrated.

I realise I could download the various data dumps and do this on my own machine, but it would be nice if it were allowed on the online version.

Is this possible/practical?

share|improve this question

1 Answer 1

up vote 15 down vote accepted

You can already do this if you want to do a bit of light hacking in your queries. And, of course, you'll have to roll your own logic to do what you're specifically asking for.

SELECT * FROM sys.databases

(All SEDE activity is IP-logged, so please don't go poking into the system databases.)

When you switch sites in SEDE, all the web app does is direct the query to the appropriate database. Since all the databases are accessible through any connection, you have access to all the data at any time -- you just have to 3-part-name the database objects.

    FROM [StackOverflow]..[Users] u1
    INNER JOIN [ServerFault]..[Users] u2 ON u1.AccountId = u2.AccountId
share|improve this answer
Awesome, that's all I need! –  Blorgbeard Mar 17 '11 at 17:09
@Mark: The point of this question was to demonstrate that cross-database queries are possible, not necessarily that the example query I provided did anything meaningful (IIRC, I just typed it from memory to make the point). However, for the sake of correctness, I have edited the answer. Thanks. –  Jon Seigel Aug 30 '12 at 12:58
Tim Stone has pointed out that AccountId is now available to join with. –  Mark Hurd Feb 16 '14 at 16:45
@Mark: Thanks; updated. –  Jon Seigel Feb 16 '14 at 16:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .