2

I've been fooling around with the Data Explorer for a while, and I was very confused when I ran the following query on Codereview, and got back unexpected results.

SELECT Id, DisplayName, Views Age, Reputation FROM Users WHERE 
  Age < 18 
  AND Reputation >= 200
ORDER BY Age ASC;

When I ran this query, I got back the following results.

Id    DisplayName    Age Reputation 
----- -------------- --- ---------- 
51332 Scimonster     3   229  <-- What the heck?      
53451 soktinpk       4   258        
13023 jiduvah        4   266        
23511 Eric S         7   272        
62429 Quill          10  336        
37303 Kyranstar      11  505        
14998 kiss my armpit 18  200        
9247  fr00ty_l00ps   22  240        
25840 Undo           23  279        
55906 Chantola       26  254        
30528 Sam Tubb       27  239        
37479 ambigram_maker 28  330        
53251 Ethan Bierlein 28  711  <-- I'm not 28! 
36483 Joseph         29  249        
40178 Hassan Althaf  110 673 

This is very odd, although it doesn't stop there. When I run this next query, it says that my age is 15.

SELECT DisplayName, Age FROM Users WHERE DisplayName = 'Ethan Bierlein';

The below are the results I get from running this.

DisplayName    Age 
-------------- --- 
Ethan Bierlein 15   <-- This still isn't correct!

Does anyone know why this is happening? I'm also noticing other values, as seen in the first table of results, not seeming quite right.

  • 1
    The results you have posted do not match the query you have shown. It appears you've edited your post to add the missing comma but have not updated the output. Please update to make sure your examples are correct. – Jason C May 2 '15 at 21:05
  • @JasonC I've changed the code back. – Ethan Bierlein May 2 '15 at 21:06
  • 1
    Your query thinks i'm a baby. :'( – Scimonster May 2 '15 at 21:59
  • 1
    @Scimonster Think of it this way, at least you'd be an extraordinarily talented toddler. – Ethan Bierlein May 2 '15 at 23:03
7

You are missing a comma between Views and Age, essentially aliasing Views as Age:

SELECT Id, DisplayName, Views Age, Reputation FROM Users WHERE 
  Age < 18 
  AND Reputation >= 200
ORDER BY Age ASC;

Should be:

SELECT Id, DisplayName, Views, Age, Reputation FROM Users WHERE 
  Age < 18 
  AND Reputation >= 200
ORDER BY Age ASC;
  • That's not what I see... You sure you are not looking at the views? – Oded May 2 '15 at 20:42
  • As for the age, what did you enter for your birthday in the profile edit page? – Oded May 2 '15 at 20:57
  • I entered 2000/12/09 for my birthday. – Ethan Bierlein May 2 '15 at 21:01
  • @EthanBierlein select * from users where id = 53251 shows views as 28 and age as 15 on CR. The site very consistently thinks you are 15, so check the birth date you entered on your CR profile. If you are seeing 28 then you are still missing that comma. – Jason C May 2 '15 at 21:04
  • 1
    So, you are expecting 14 there, not 15? Not sure how the import calculates age - could be a date issue somewhere. – Oded May 2 '15 at 21:05
  • Yes, I am expecting 14 to show up. – Ethan Bierlein May 2 '15 at 21:05
  • @Ethan - Can I ask when you updated it last and what from? The data explorer is updated once a week, so that could be it (calculation done from the older figure). If that's not the case, it is possible that the data explorer import is not calculating age properly. – Oded May 2 '15 at 21:10
  • @Oded Updated age? Or updated profile in general? – Ethan Bierlein May 2 '15 at 21:21
  • @Oded As far as I remember, last I updated my profile was last night around 12:00 US Central time. – Ethan Bierlein May 2 '15 at 21:25
  • @EthanBierlein - birthday, specifically. – Oded May 2 '15 at 21:25
  • @Oded I'm not quite sure, but it seems like it was around 7 months ago when I entered it in for the first time. – Ethan Bierlein May 2 '15 at 21:29
  • 1
    I think it always rounds up for the current year (to prevent making it too easy to guess a large number of user birthdays based on the results, maybe?) Not sure if that's intentional or not, but this has come up before. – Tim Stone May 2 '15 at 21:49
  • @TimStone - that's what I am thinking (the import predates my employment at stack, but this is certainly the kind of thinking I'd expect). Given weekly updates to the data explorer, this limits the possible personal data leak. – Oded May 2 '15 at 22:06
  • @Oded So it adds a year onto everyone at some point in the year, so that you can't get someone's birthday? It would appear that everyone's birthday is the same? (i.e. that date). – Tim May 3 '15 at 9:53
  • 1
    @Tim - I haven't looked at the code or spoken to the people who wrote it (it is the weekend, you know...), but I'd expect so. – Oded May 3 '15 at 13:20

You must log in to answer this question.

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