« first day (840 days earlier)      last day (4026 days later) » 

9:00 PM
@ypercube isn't that an Excel plugin?
 
@ypercube The Excel thing? Nope, I've never used it.
Let me see if I have it installed
 
I do not mean the Excel plugin (although it does the same thing)
 
@LewsTherin hahaha. i just made a tongue-in-cheek comment about that
 
I meant what pivot queries are
 
it's actually a SQL keyword/function/operation/?
 
9:01 PM
@ypercube Nope
 
Enter @bluefeet
 
Ok. Forget that. You do know what a junction table is though. Right?
 
Yeah
Formed in a M:N relationship
 
All right, so an (exam, student) junction table is an example.
 
Yeah
 
9:04 PM
If you have 1000 different exams and 1000 different students, how many rows does the table have?
(trick question)
 
♪ conjunction junction, what's your function ♫
 
@ypercube Eh.. depends
 
on what?
 
@ypercube which table?
 
@ypercube If each student takes all exams. I think
Which isn't usually the case
Maybe takes the same amount of exams? Anyway, there isn't an exact relation between student and exam..
 
9:07 PM
So the table may have 0 rows or 1000s or millions
 
Yeah..
At most 1,000,000 I think
 
The cube for that would a 1000x1000 matrix.
a 2D matrix. In all cases, no matter if the table is empty or has 1000s rows
does that make sense?
 
Yeah, indeed.
The cube for that..
Ok that doesn't make sense..
How is a matrix a cube? :(
 
If it was (exam, student, result) would it make sense?
 
@LewsTherin it is if it has 2 dimensions :-)
 
9:10 PM
@ypercube is "The Architect"
 
@Lamak Ok I need to check the definition of a cube again
@ypercube Um question.. I doubt if 1000*1000 is correct
 
why?
 
That's saying there are 1000 cols and rows
But you only have 2 columns
 
@LewsTherin because you keep thinking about tables
 
@LewsTherin you're not thinking theoretically enough ... it's like the whole "a circle is a rectangle" thing
 
9:11 PM
in the table, yes, you have 2 rows.
If you were to store this (say in Excel) and put one row for every exam and one column for every student, what would you have?
 
but in this case you need to imagine that every student (or exam) is a "column" (and I'm using "column" here since you seem to be attached to the name for now)
 
@ypercube 1000 rows...
 
@LewsTherin and how many columns?
 
@Lamak I don't know why.. tables keep popping into my head
@swasheck He did say 1 column... ?
 
"@@ROWCOUNT is more efficient. Just never mind that I got it by populating a #temp table!"
 
9:15 PM
Oh 1 column for every student
 
@Aaron not scanning the entire table, i'm utilizing an index for the data I'm selecting, inserting it into a temp table, and from then on, I'm operating on the temp table (in memory) to get the row count as well as get the top 5. What am I doing wrong or awfully inefficient? — sOltan 2 mins ago
 
@LewsTherin violate every rational thought on normalization. take every best practice that you mock your business users for doing. there. you have the makings of a data warehouse
@LewsTherin yep
 
@ypercube That's a really sparse matrix rofl
 
@LewsTherin Yep.
 
@AaronBertrand "will do, thanks!"???
 
9:17 PM
@ypercube Are you finished? Please don't say you are.. otherwise I've completely missed the point :(
 
@swasheck that wasn't to me. That was direction from someone else to pick an answer (probably a poor one) and move on.
 
@AaronBertrand ah.
 
@LewsTherin he was trying to explain that cube image that you posted
every different student is a different value on one of the axis
 
Now imagine you have the new version of 3D-Excel and you pile 100 (sparse) matrixes one above the other.
What do you have?
 
"Thank you for your time. I totally missed everything you said, and am going to completely ignore it and do it the way I think is least inefficient, but thanks nonetheless."
 
9:18 PM
and diffent exams are on the other axis
 
Sometimes you just can't make enough sense to people.
 
and different values for "Results" would be the third axis
 
Brilliant
Hold on.. I know it is within my reach
 
even though i answered it ... this should still be closed
2
Q: SQL - Is there any way to simple count it?

Bolek AksińskiFrom two days i'm trying to solve some problem - without success. This is my table user_actions: userId | actionId ------------------ 12 | 0004243 12 | 0004243 12 | 1346454 542 | 4356675 235 | 1346454 235 | 0004243 235 | 1346454 235 | 1346454 and I need to count, ho...

 
I got as far as piling the matrix upon one another.. which obviously forms the 3d matrix :D
 
9:21 PM
@swasheck hey, you reached your goal, congrats. You'll get your bounties on 19 more hours
 
Incidentally forming a 3rd axis.. right?
 
@LewsTherin right
 
@LewsTherin Right. A (perhaps) very sparse matrix. But you can slice it easily in any direction you want. Say, you want only those results where result=67 -> slice horizontally. You want all those results that exam='Phyics' -> slice vertically, etc.
 
1
A: SQL - Is there any way to simple count it?

Gordon LinoffThe correct query uses count(distinct): select actionID, count(distinct userId) as howManyUsers from table group by actionID

 
Wow, he spent two days on that? I smell a promotion!
@swasheck actually your answer doesn't give the desired result - look closer
 
9:23 PM
@AaronBertrand lol
 
I up-voted the other count(distinct) answer. I didn't upvote Gordon's not because it's incorrect but because I know he didn't test it.
 
@ypercube To be honest, I think that's confusing :(
Do people really get to work with that kind of stuff?
They must be geniuses
 
@AaronBertrand yeah ... that's why i posted it
announcing my own shame
and my faulty requirements gathering
 
When I look at the 3d matrix ( a stack of 2d matrix).. it forms an individual cube? Does that make sense
 
@LewsTherin only because you are thinking that it is literally a cube
no need for that
 
9:27 PM
Stick with the 2d version then (of 1000x1000).
If you have that in Excel, it's easy to find the results of a student. You just move to his column and read (all the way from row 1 to row 1000).
If you want a specific exam, you go to that row and you look all the way from column 1 to column 1000.
 
@swasheck 2 days. That's pretty amazing right there.
 
@ypercube Yeah, that's easier.
 
@AaronBertrand where do they find these people.
 
@ypercube What if you add a fourth dimension? Would Excel break? :D
 
@LewsTherin It's just another level of aggregation
 
9:30 PM
@Zane i found this one and, in this instance, i was one of "these people"
 
@LewsTherin so, lest's stick with the columns being each student, right?
 
@LewsTherin Then I say no more. Lamak and almost anyone else here knows much more about these things than me. Sorry for any confusion I caused.
 
@Lamak Yeah I guess
@ypercube It's OK. Good attempt me thinks
 
@swasheck??
 
@ypercube hey, I found that your explanation was very good
@LewsTherin and you have another dimension (the rows) being every exam
 
9:32 PM
@Zane i posted the question in here and i was one of the idiots that answered with a crap answer
 
@Lamak Yeah and [r][e] maps to a result.. the 3rd dimension, right?
 
@LewsTherin well....no
not necessarily, at least
 
Dang :)
 
@LewsTherin No. We stick to 2D for now. We don't want to break your Excel :)
 
@LewsTherin it could be
 
9:33 PM
@Zane you rang?
 
@LewsTherin so, you have 2D and have your columns and rows
 
@ypercube Lol! :D
 
@bluefeet someone mentioned explaining pivot.
 
@Lamak That's right
 
@bluefeet a while ago. he left three voicemails!!!! where have you been??!!!???!!!
 
9:34 PM
@LewsTherin what is the value inside that "cell" that is defined
 
The result
 
@swasheck sorry i was eating dinner with my family!!!!
 
@LewsTherin if that is your "measure", then yes
 
I know I should never leave the HEAP
 
@LewsTherin but in this case, aggregating the results might not be what you want (or it might)
 
9:35 PM
@swasheck I was more commenting on the OP mentoning he was working on that for 2 days.
 
@bluefeet psh. dinner.
 
@Lamak Alright, so it could be any measure really
 
@LewsTherin right
@LewsTherin but it should be aggregated. So you could calculate the SUM or the MAX of the results for one studend on all exams
or the results could be another dimension
 
@Lamak sounds like a bad scifi episode
2
 
@Lamak Hold on.. so are you saying that a [r][c] should map to an aggregated measure?
 
9:38 PM
@swasheck yup, it does
@LewsTherin yes
 
That can't be useful
 
@AaronBertrand So inclined to post a question with "I've working on this for ten years. ... Can you help me".
 
in this particular case, for that cell, you would need no aggregation
 
@ypercube that'd be in the behavioral sciences SE for me ...
 
@LewsTherin what happens if your base table wasn't about grades, but sales from a store. You would have many columns, but you wanted only "city" and "day" and the sum of the amount
does the aggregation make sense now?
 
9:40 PM
"how do i stop the irresistible urge to fart in an elevator? i have this tendency and i've been working on this for the last ten years ... can you help me?"
 
@Lamak Yeah, so the aggregation is simply to save space
 
I wish I could fart on a question and then log off.
 
@LewsTherin not only that
@LewsTherin damn!, I hate to leave an explanation in the middle, but I should've left work an hour ago.....
 
@AaronBertrand what a peculiar thought.
 
@AaronBertrand i just did on that count distinct question. actually, i think i had diarrhea of the keyboard.
 
9:42 PM
@LewsTherin I really can't stay any longer....I'll be here tomorrow, or many people here can clarify what I was saying
 
@Lamak The feeling is mutual.. but I shouldn't hold you! Thanks, I hope your students appreciate you :)
 
@LewsTherin sorry again
 
@Lamak Ha ha I will survive for another day, don't worry ;) Enjoy your day!
 
@LewsTherin good to know
 
@Zane Because I'm the fresh prince
 
9:52 PM
@FreshPrinceOfSO Really, how fresh are you at this point in the day?
 
@MikeFal About to fall asleep.. Still have to meet with another professor; then drive home in wonderful Chicago Rainy Traffic
 
@FreshPrinceOfSO do you ever feel ... "not-so-fresh?"
 
@swasheck Strong enough for a DBA, made for a dev.
 
@MikeFal close
this was an awesome commercial
 
9:59 PM
@swasheck Imagine if they had slogan-ed it "Do the douche."
 
10:12 PM
@MikeFal third recruiter today has contacted me RE: oppenheimer. they seem very intense for me
 
@swasheck Yeah, they've been hunting for a while. Brandon has been giving me a bit of a soft sell myself, but the commute man.....the commute.
 
@MikeFal they're basically down the street from me but my t-sql is crap
 
@swasheck What's the worst theyc an say, "no"?
 
anyway ... it just stinks
i've lost 4 "friends" (work friends) so that's sad (from here)
but i just keep laboring away
 
Good word, my editing sucks
 
10:15 PM
i know the whole networking thing is supposed to be good ... but it's suck to be a disappointment and have everyone in the UG talk about you :)
not that i'm really all that important :)
 
@swasheck What do you mean, disappointment? How are you disappointing people?
 
i'm not ... yet ... i'm projecting out 6 months down the road ... hired at oppenheimer ... disappointing hire ...
:)
 
BAH
 
good thing you're not married to me ... i annoy my wife like crazy
 
You won't disappoint anyone. If anything, the UG/community will want to do what they can to help you succeed.
 
10:22 PM
well that's cool of them.
 
Question?
 
42
 
@LewsTherin 42
 
42? :P
 
42 (forty-two) is the natural number immediately following 41 and directly preceding 43. The number has received considerable attention in popular culture as a result of its central appearance in The Hitchhiker's Guide to the Galaxy as the "Answer to the Ultimate Question of Life, the Universe, and Everything". Mathematics * Forty-two is a pronic number and an abundant number; its prime factorization 2 · 3 · 7 makes it the second sphenic number and also the second of the form { 2 · 3 · r }. As with all sphenic numbers of this form, the...
 
10:26 PM
I was reading then.. I saw cubes
 
my god ... it's full of cubes
 
Billions and billions of facts
 
Ah I see the reference now :P
 
What is six times nine?
 
Rhetoric?
I can never tell if software engineers are serious
 
10:28 PM
Man....you need..NEED to go read Hitchhiker's Guide to the Galaxy
 
I will add it to my list :)
 
waves hand you will read it next
 
Lol!
Won't happen ha.. I have a book lined up already :D
 
What's your next book, then?
 
AMoL
 
10:30 PM
Full title, please
 
A Memory of Light
 
Yeah, it can wait
 
I was right... not a fan.
@MikeFal It can't!
Take it back!!!
 
Hitchhiker's. It's a quick read and will change your life. I promise you.
You can come back to A Memory of Light
 
We'll see ;)
 
10:32 PM
@MikeFal it's all about Enders Game
 
Ender's Game is a fantastic book. It really is. But, seriously, I can't think of any book someone should read before Hitchhiker's
 
AMoL
WoT series
ASoIaF :D
 
@LewsTherin LMFAO?
 
:D :D
All books by Feist
 
ZOMGWTFBBQ!!!!!?????!!!11111
Faust?
 
10:34 PM
Dude, WoT was SUCH a waste of time. I was done after book 7.
 
@swasheck Robert E Feist
 
@LewsTherin to many anagrams and initialisms there for me my good man.
 
@Zane anagrams?
 
Ummm.....Wheel of Time was Robert Jordan, not Feist.
 
@MikeFal A lot of people have told me that. A big loss. It got REALLY good.
 
10:35 PM
@swasheck oops wrong word.
 
@MikeFal Yep, another series by E. Feist is a must read
 
I've read the Riftwar and Daughter of the Empire stuff.
 
Magician, The Serpent War, God War, Wrath of a Mad God
 
dude ... i love liszt
 
@MikeFal :D
Good good books
 
10:36 PM
acronym lol
 
I love acronyms
 
Doing to many things at the same time.
 
Yes. I read good books. Which means you should take my advice and read Hitchhiker's next.
Period. Full stop.
 
Almost spelled that thyme... see.
 
@Zane :D
 
10:37 PM
@Zane are you going to scarborough fair?
(you're probably too young)
 
@swasheck I don't need to be old to know my music references.
Now I have simon and garfunkel in my head.
 
it's all part of the plan
 
Going to bed. Later lads!
And thanks all
C ya tomorrow.
 
Oh I do love a spot of dbareactions after a long day
 
seriously wtf with the downvotes on this?
1
A: Sql query returns only one row (LIKE)

bluefeetYou will want to include the wildcard % character to include the rows the have George present in the name: SELECT * FROM customers WHERE Firstname LIKE '%George%'; If George will always appear at the beginning, then you can include the wildcard on the end: SELECT * FROM customers WHERE Fir...

 
10:42 PM
@MarkStorey-Smith Indeed. Now help us convince @LewsTherin that he should read Hitchhiker's Guide to the Galaxy. Now.
 
@MikeFal @LewsTherin Cancel tonight's sleep.
 
I do have a lecture at 9 you know :(
 
@MarkStorey-Smith Oh, that's not just for @JNK. It's for me too.
 
10:46 PM
the SharePoint database doesnt work ... it limps
(and it's a collection of dbs with random GUIDs tossed in the name)
 
@swasheck One of the SQLSkills folks (Paul I think it was) swears that sparse columns were bumped up the feature list, just because the Sharepoint team needed them so bad :)
 
@MarkStorey-Smith sharepoint was a cute idea
 
There's a reason SP consultants make so much money.
 
I got paged and I have bever helped this person before
@bluefeet Can you please have a look at this? — Ssa Srt 2 hours ago
 
@bluefeet the answer after yours is mind blowing.
 
11:07 PM
I love when someone posts a SQL problem and the first guy to answer is like try parsing it through this PHP script/C#/Python script. If that were evan an option don't you think the OP would have tagged it!
 
Here's a doozy that surprised me so much I need to tell everyone about it, just in case it happens to you....
1Gbps network interface, 1Gbps switch, all of a sudden the card refuses to play at anything more than 10mbps. The fix, turn the power off for 15 minutes. The explanation which I gleaned from an obscure thread on an even more obscure message board, the PHY chips in your network card can go a bit nuts in response to power fluctuations and will retain their settings thanks to WOL keeping them powered. Power off for long enough, all is well again.
Awesome, thank you internet.
 
Alright guys I'm out for the night. See you tomorrow.
 
11:45 PM
Can someone else please try to stress to this guy why sample data and desired results are important? So many cycles have been wasted providing the wrong solution:
0
Q: How do I determine employee's most current dateofEntry?

KennyEach employee is given an opportunity to record date of visit up to 3 visits. How do I determine employee's most current date of visit and add 3 years to it? I tried the following: select top 1 dateOfVisit from table where empid=123 Order by dateOfVisit DESC This isn't giving me most ...

What the heck does "subtract current date from it" mean? I'm going to ask you again for SAMPLE DATA and DESIRED RESULTS so we can stop playing word problem games. Until you provide that, I will ignore this question, so please stop commenting to me until you have provided that. — Aaron Bertrand 8 mins ago
@bluefeet it's called revenge based on assumption - you must have been the one to download the other answers, so they're paying you back.
 
@AaronBertrand I think it is jw's cult of followers.
 
@bluefeet possibly. That guy just comes off as more as a **** as each day goes by.
 

« first day (840 days earlier)      last day (4026 days later) »