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

6:00 PM
Can't this is at work.
"To anyone who has to support this code, I appologize for this section."
 
Did you inherit one of my packages?
I always try to provide a cigarette and blindfold to anyone who has to maintain a package with F'd up business rules
 
JNK
~~
XXEEEEEEEEEIIIIII
or something
 
did i misread this one?
0
Q: How to loop through results in an sproc?

CupsI'm learning about stored procedures in mysql (5.5), and have hit a bit of a mental block here about what can be done using sprocs. The base data looks like this: select * from fruit; name | variety | price | quantity --------------------------------- Pear Comice - 15 - 2 Pear Barlett - 20 -...

 
JNK
I think he wants a SUM and GROUP BY though
 
As a MySQL ignorant (thank the gods), is the CASE somecolumn WHEN 1... works?
 
6:08 PM
@Lamak i dunno
SWAG
@JNK srsly?
 
JNK
SWAG?
 
@JNK scientific wild-azz guess
 
JNK
he wants a total for all Pear and a total for all Apple
from what I read
 
I agree with JNK
but not on the last past.
 
@ypercube will the case logic parse in mysql?
 
6:12 PM
MySQL probably has some hackedass function like GroupByFruits
 
aw shucks ...
vat is a parameter
 
My SWAG Is he needs: WHERE name = @variety GROUP BY Type
 
JNK
@swasheck FTFY
 
Hey
 
yeah
thanks
 
JNK
6:13 PM
AHHH THE DRAGON REBORN
LIGHT SAVE US
 
Lol :P
 
JNK
@LewsTherin I mean hi
 
Unfortunately, I am behind by a book :(
@JNK Hello :P
 
JNK
oh man the last one was awesome
 
@swasheck Your code looks fine.
 
JNK
6:14 PM
Best one in like 6 books
action packed, very satisfying, I have nothing but good things to say about it
 
That's what I pretty much heard. So after exams, I am going to straight to the book shop
 
JNK
I'm assuming you came in with a SQL question though
or another database
 
I need explanations yeah ;)
 
JNK
shoot
 
Any experience with datawarehousing, dimensions, Olap?
 
JNK
6:16 PM
Several of us have that yes
a couple of folks in here make their livings in DW
others (me) dabble
 
That's cool, to clarify are dimensions used in querying the fact table?
 
JNK
kind of
the dimension is an aspect of the entity represented by the fact grain
they are used to inform and reduce your data sets from the fact table basically
 
But data from the dimension is already loaded into the fact table right?
 
JNK
some of it
at a minimum the key should be
if its a snowflake then other relationships may not be
there may also be data in the dimension that describes the dimension entity that is not in the fact
If my fact table represents transactions, and i have a customer dimension, some info on the customer will be in the dim but not the fact
 
Right..
So when will you use the dim?
 
JNK
6:20 PM
What do you mean
If you want to see transactions by a certain customer then you would use that dimension table
SELECT <stuff> FROM Fact INNER JOIN Customers C on C.Id = Fact.customerId WHERE C.Parentcompany = 'Bayer'
 
I see.. that's what I was wondering about..
 
JNK
though depending on your size you may want to put that parentcompany at the fact level
 
So star schema doesn't remove joins
 
JNK
oh no but it makes them all inner joins
and eliminates key lookups if you do it right
 
Are inner joins the fastest then?
 
JNK
6:22 PM
the dimensions also help in reporting as they give you a distinct list of the attribute values materialized
hard to say what's fastest
 
I just had the odd idea that facts should be completely denormalized
 
@LewsTherin but, are you talking about OLAP?, or a relational database?
 
JNK
they should be as denormalized as you can make them
 
@Lamak I'm getting to OLAP.. I just want to grok the basics first :P
 
JNK
like everything else It Depends™
the INNER is simpler for most purposes especially if you are just using it to limit your search
 
6:24 PM
That's sort of clearer now.. thanks.
OLAP..
Star Schema is one way of implementing OLAP right?
I don't get how the cube works though
 
@LewsTherin it's a different paradigm altogether+
 
@Lamak It uses star schema or cubes.. I want to understand where they fit in
 
you need (or really, you want) a relational database with a star schema as the data source for your cube
"multidimensional modelling" as some call it
 
The thing is.. I don't get how the cube works. How do you query a multi dimensional query?
The way I see it.. it appears to be some sort of advanced aggregation lmao
 
@LewsTherin basically, yes
 
6:27 PM
So instead of aggregating by column, or attribute you aggregate by.. another table?
 
like an Excel pivot table
 
Furiously googles
 
@LewsTherin first, you need to understand that it's another kind of database, a multidimensional database
 
Mmn. ok a normal database is 2d right?
X, Y or ROW, COL etc..
 
JNK
Think of the cube like an actual cube
 
6:29 PM
that it's stored on a way that's designed to be fast when performing aggregations from a big amount of rows
@JNK an hypercube
 
JNK
but it could be a cube with 20 dimensions
your data is the intersection of all those dimensions, which gives you a point in space
 
@LewsTherin is not that's 2D, it's that it's a relational database.
 
JNK
If you think of it like a 3d cube, and your data has 3 dimensions....
let's say you have customer, agent, and product dims
Where those 3 dimensions intersect you have a fact row
 
By intersect, if they have the same id's right?
cus.id=agent.cusid=product.cusid
 
@LewsTherin you need to stop thinking with JOINS
:-)
 
6:32 PM
This is going to be a challenge lol
 
JNK
So think of a 3d graph
your X has values from 0-100
so do Y and Z
WHERE x=1 and Y = 20 and Z = 44 is a point in space
it's also a fact row or rows in a cube
 
@LewsTherin I think that you first need to understand cubes and why they are useful on some scenarios
 
@LewsTherin are you looking to develop a cube or working with an existing one?
 
@LewsTherin do you understand Pivot tables?
 
JNK
cubes basically make it much easier to run queries/reports/browse large dimensional datasets
they also enable data mining and stuff
 
6:34 PM
@Lamak Never used it :(
@Zane Neither.. just need to understand it for the exams.. instead of memorizing
 
@LewsTherin really?, on Excel?
 
@Lamak I believe so
@Lamak Seriously, I've never used Excel personally. Except to open spreadsheet stuff
 
Don't think of it as 3D because the moment you try and bring a 4th dimension in, your brain won't be able to conceptualize it.
I thought Mark Vallincourt did a good job explaining it in this presentation markvsql.com/mdx-trek-first-contact
 
@billinkc Downloaded.. thanks
 
@LewsTherin ok, so, going to the basics. Imagine you have the sales data of some store. It's all on one big table, with every transaction that gets made. How do you calculate fast the sales amount for this month?, imagine you have many stores and millions of transactions per week
 
6:37 PM
I have a question that I'm not sure would be on-topic or not for the site
 
@Rachel Ohai :D (Probably don't remember :D)
 
@LewsTherin I remember you from SO :)
 
@Rachel 42
 
It should be easier for me to think of a simple way to explain this.
I learned cubes before I had a grasp on relational databases.
 
@Lamak Sum and Group by store, month I think
 
6:38 PM
Pages 19-23, make it easier to think about the intersections between slicers (dimensions) and facts
 
@Rachel :D
 
@LewsTherin ok, sounds easy enough.....but how much time will that take?
 
The network admin here uses 3rd party software to back up our SQL database using the VSS writer service, which breaks the backup chain. He's very much against changing that policy, but I feel strongly that it would be better to let SQL manage the backup process, and to backup the backups with the 3rd party software. I'm not sure if this is reasonable or not, and would be looking for strong arguments to demonstrate the reasoning behind this, along with documentation, preferably from Microsoft
 
and if you have the whim to test sales per week?
or day?
 
Would such a question be OK? Or would it be considered not-constructive or off-topic?
 
6:39 PM
what if you want the distribution by city, or client?
 
@Lamak Well, depending on the amount of record a good while me thinks
@Lamak So you are saying it takes a while to modify queries?
 
@LewsTherin no, that's fast
 
@JNK @Lamak maybe it would be better if he just downloaded the Microsoft example cube and played around with it in excel. That should pretty quickly give him an "aha" moment.
 
but think about management. The user wants to find trends or test some ideas, see distributions
 
JNK
@Rachel does their 3rd party software not support copy-only backujps?
those don't affect the backup chain
 
6:41 PM
management won't want to wait hours or days just for test something, they'll want to get results faster
 
Right..
 
@JNK I don't think so... one is ArcServ and the other is LiveVault/Iron Mountain (don't know if you've heard of either). Both appear to break the backup chain when they run, and I don't see any settings for changing it to copy-only
 
@LewsTherin that's why OLAP means On Line Analytical Processing
@LewsTherin that's where this multidimensional databases come to play a big role
They are designed for performing aggregations
 
@Lamak Are you going to be here in an hr? I have to leave college..
 
@Zane right. But since he said he wants to understand for some test, I want to try to clarify some concepts first
 
JNK
6:43 PM
@LewsTherin you should transfer to Chile
 
@LewsTherin don't know, sorry
but if I am, I'll be happy to help
 
@Lamak That's cool :P
 
JNK
(lamak teaches BI in Chile :))
 
@JNK Mmmn, why?
@JNK Oh, I see :D
I have a class in BI, but stupid me I didn't take it because of "Business"
 
@LewsTherin oh, I see....damn business
 
6:45 PM
I really have to go.. talk soon lads. And thanks :P
 
giving a bad name to BI
 
Who wants to give me 4k rep?
 
@FreshPrinceOfSO rep has to be earned sir.
Why do you think mine is so low? :)
 
Can we get some more downvotes please?
-13
Q: Can't find: "syntax error, unexpected $end"

user2312488i just can't find where's the error in the php file. Its still showing the error: "Parse error: syntax error, unexpected $end in /var/www/html/admin/maker/plan_informeinfo.php on line 897" Please! Help, i don't know how to figure that out This is the code: <?php // Global variable for ta...

@Zane You switched jobs?
 
@FreshPrinceOfSO Why? It's already at -13
 
6:50 PM
@Lamak you've inspired me ... i've answered another SO question
 
Yeah, -14 would be harsh.
 
@Rachel -13 just looks weird.
Really.. someone upvoted it?
Smells like @Lamak
 
@FreshPrinceOfSO I just gave away 1k dude, find someone else. I still don't reach 20k myself
 
@FreshPrinceOfSO lol you're making me want to upvote it too just to mess with you
 
@FreshPrinceOfSO worst code dump ever?
 
6:52 PM
@swasheck that's what I was expecting :-)
 
@Lamak How does one give away 4k?
@Zane It's up there.
 
@FreshPrinceOfSO sorry, meant 1k
 
@Rachel I'll virtually slap you
 
@Rachel no-one in good concience could upvote that.
 
But seriously, it's a bad question and already voted down far enough to kick it off the front page and make the user feel bad. Why bring it up here for more downvotes? :p
 
6:55 PM
@FreshPrinceOfSO do I smell that bad?
 
@Rachel Because humanity is cruel. And this being the interweb, well it takes it to a new level. I can be mean without humanizing with people.
@Lamak You do upvote questions Aaron doesn't like
 
@FreshPrinceOfSO I do?, don't remember that. I do remember having downvoted Aaron, though I still swear that I don't know how did that vote got there in the first place
 
There is someone who is removing the and not voting to close obvious too localized questions
1
Q: INSERT...SELECT FROM Mysql statement error

LarsI have a list of items in a table that have ids, and I want to put them into a item_to_group table, all with a specific group number. My MySQL code is: INSERT INTO `item_to_item_group` (`items`.`id`, 3476) SELECT `id` FROM `items` But I'm getting the old "You have an error in your SQL syntax"...

 
TWENTY POINTS AND THEN @Lamak WILL BE A HERO
 
@Rachel The power of the downvote
 
6:58 PM
@swasheck haha, you do have something to contribute :-). And you'll have to wait till tomorrow
 
JNK
@swasheck HAPPY APRIL
 
@Lamak meant to say downvote.
 
a reasonable person
@bluefeet: Good point - will do. (I'll go back to ones I previously processed as well) — SimpleCoder 1 min ago
 
@FreshPrinceOfSO Why a animated gif? Have we done something to be punished like this?
 
@ypercube I will try an animated jpeg next time
 
7:03 PM
@FreshPrinceOfSO What @ypercube said. I shouldn't have to delete these things in Chrome
 
@MikeFal?
 
@MikeFal refresh :)
 
@JackDouglas You've killed a piece of me.
 
@JackDouglas No need to, already deleted the node
 
@JackDouglas you mods and your crazy powers
 
7:06 PM
So does JW only edit tags on questions his answers are accepted in? stackoverflow.com/posts/16172083/revisions ; stackoverflow.com/posts/16173103/revisions.
I'm glad @AaronBertrand is on top of it.. stackoverflow.com/posts/16170841/revisions
 
@FreshPrinceOfSO yes, yes he does
 
@bluefeet This is seriously getting annoying.
 
@FreshPrinceOfSO you could downvote me somewhere in return?
 
@FreshPrinceOfSO nah, the ones that he answers
 
@JackDouglas Nah you look too chipper in your gravatar
 
7:08 PM
He does it on any questions that he answers. then his cult of followers upvotes him thousands of times
 
I want a cult of followers
 
Agreed.
 
See, follower #1
 
Unless it's on SO. I want a real life cult of followers.
 
7:11 PM
@Zane That's too creepy. Online cult of followers is better.
 
The nice thing about since it's a tag, I can just browse the tag for new questions and untag them
 
@billinkc my followers would get bored as I only manage to find time to answer about 2 questions a month.
 
@FreshPrinceOfSO my online cult can't smite my enemies though...
@FreshPrinceOfSO guy needs more tags. Got to have those badges man.
 
@Zane That's it
 
7:15 PM
@FreshPrinceOfSO how else would one gauge ones life worth.
 
Please; stop adding unnecessary tags to questions. This just makes it look like you're doing it to get the badges. Myself and others will continue to remove them and roll them back if need be. — FreshPrinceOfSO 4 secs ago
 
@Lamak I don't think there is anything wrong with . It is the same thing as using the but the issue is he is adding them to EVERYTHING
 
@bluefeet @Lamak There's nothing wrong if the OP uses them. But if JW comes in and decides to add it, then we burniate it.
 
@bluefeet Oh, I know, I just started browsing that tag and has so much garbage
 
7:20 PM
@Lamak there are lots of garbage questions. We just don't have enough power to close them all.
And then you have people like jw who never votes to close anything
and it adds to the garbage
 
@bluefeet didn't even notice this
 
There are plenty of times that I will VtC a question as too localized but will add an answer to help the user, especially if the answer will be too long for a comment
@FreshPrinceOfSO I don't think he ever closes anything
Like this one, I Voted to Close it but gave the user an answer.
4
A: Error Code: 1064. You have an error in your SQL syntax; 3 table mysql join

bluefeetYou have a few issues with your query. First, you are attempting to create an alias using a reserved word group. You will have to escape the reserved word using backticks. Also, you should have separate sets of backticks around the table and columns name, they should not be enclosed in a single...

That would have not fit in a comment
 
@bluefeet You're doing the right thing
 
7:37 PM
@JNK I still don't understand why on your meta question, you got the "only on emergencys" comment, and then we have this one on a previous question today:
Wretched tag. Burn with the fire of a thousand suns. — Robert Harvey 20 hours ago
 
JNK
@RobertHarvey DOUBLE STANDARDS I SAY! — JNK 10 secs ago
 
Public Service Announcement: There are only two ways to remove a tag without involving a Stack Exchange Developer: synonymizing the tag with another tag, or removing each tag instance individually. Developers are only involved when it's an emergency. — Robert Harvey 5 hours ago
@JNK did you do something to the big mods? ;-)
 
Can I get paid in rep to burniate this tag? I'm thinking 200/rep/hour is a fair market rate. — FreshPrinceOfSO 4 secs ago
 
JNK
@FreshPrinceOfSO No way are you getting an hourly rate for this. It will be by post obviously
 
7:56 PM
WTH, it's error 1033 and yet, they use the tag of burnination
0
Q: MySQL error on working machine and on old working copy

asclepixIn 2009 I've made a machine with a working MySQL database and a copy of the HD with dd. The machine has worked fine until some days ago. Now, when I enter in the database I obtain: Didn't find any fields in table 'CoBi' Didn't find any fields in table 'diam' Database changed When I query thes...

 
8:08 PM
@Lamak Well you know, bringing intelligence to the business.
 
Hello again
 
@ConcernedOfTunbridgeWells :-), just messing around for a litttle while
 
Hey Lamak, still here I see :)
 
@LewsTherin yup
 
Ready to get back to lecture mode? :P
 
8:15 PM
though you have now a really really really knowledgeable guy about BI here
 
I thought that was you? :P
 
@LewsTherin I know something about it, but @ConcernedOfTunbridgeWells it's on another league :-)
 
I don't mind where I get help from.. as long as one can dumb it down for a simpleton like me :P
 
@LewsTherin well, ok, so where were we?
 
Something about multidimensional databases designed for aggregation
 
8:19 PM
@FreshPrinceOfSO why would we pay you to do something you're doing for free right now?
 
@LewsTherin ok, well, they are designed so you can perform that kind of aggregation faster
 
Mmn, can we digress a bit. What makes a relational database... well relational Dumb question I know..
I doubt it is because entities have relationships
That's too simple right?
 
@LewsTherin it's not about entities and those "relationships", that another kind of modeling
in fact, those relations can be translated into tables on a relational database
 
@LewsTherin No, it's because tables are relations.
 
Dumber and dumber, relations.. how?
This is math stuff right?
@Lamak You mean normalization?
Many to many relationship becomes junction table
 
8:25 PM
@LewsTherin nope. I meant that you called them " entities" and "relationships", so I think that you were talking about an "entity-relationship model"
 
@ypercube Oh I gotcha now ;)
@Lamak Yeah, that distinction was intentional, looking at the definition.. I is very wrong
A relational database stores tables or relations.. collections of tuples or attributes
That is more or less cleared up.. so what makes multidimensional database different?
Does it store stuff as tuples ?
Or does it remove rows of tuples? Is it stored like a 3d array?
 
@LewsTherin oh boy, how is it stored is kinda out of my expertise
 
Ok, that's too low level ;)
What makes it multidimensional :D
 
@LewsTherin It's not really complicated
just that you need to think about it from another point of view
so, let's go back to the store example
 
8:34 PM
@LewsTherin You first want to define what group of measures you want to analyze, so let's say "Sales". This means that I want to see amount, costs, revenue, number of items, etc
those are our "measures"
 
Question
 
yup
 
What is the grain of the data, day, week or year? Is that even relevant?
 
@LewsTherin We are getting to that
 
Sweet
 
8:36 PM
@LewsTherin you need to define how do we want to "see" that data. Sales by year, month, day, store, city, etc
 
Good, that was another confusing thing. Does that mean we create separate dimensions for the granularity?
So we have a DateYear dimension DateMonth dimension etc..
 
Those things become the "attributes" for your dimensions
 
Nope, 1 dimension as the lowest level of grain
So day because you can build a hierarchy of days become weeks, weeks become months, etc
 
And the "dimensions" would be "time" and "geography"
 
Can we focus on the dimension thing before we go further.. taking the date dimension:
 
8:39 PM
So, very basically, you have multiple "dimensions", that are groups of "attributes" wich you want to use to "slice" your "measures"
 
DateDimension
Year | Month | Day
Is that correct?
 
Could be time as well
 
@LewsTherin If those are the attributes that you want, yes
 
And then for the query we can aggregate by either year, month or day or either.. right?
 
@LewsTherin right
 
8:40 PM
In the fact table only the surrogate key of the DateDim will be stored
 
and since you can have multiple dimensions, you have a multidimensional database
@LewsTherin That's a good practice, yes
But it's not absolutely necessary
 
@Lamak Mmn, that's confusing... isn't a star schema multi dimensional by that definition?
 
@LewsTherin I don't know if you are talking about a star schema on a relational database level or about the hierarchy relations on the multidimensional level
But, don't get stuck on the "naming" convention
 
Oh great.. mm.. let's start with star schema
 
@JNK who's april?
 
8:44 PM
Can a star schema be in both relational and multi dimensional databases?
 
Why do people just refuse to get this?
And in the example you gave here, if there is an index on the four columns mentioned, it will likely be used as opposed to the clustered index, since it is skinnier but still has to scan. DO NOT RELY ON ORDERING WITHOUT A WELL-DEFINED ORDER BY. — Aaron Bertrand 39 secs ago
<facepalm>
 
i've earned the edit question privelege ...
elbow, elbow, wrist, wrist
 
@LewsTherin Some people use the same name when talking about a schema of a fact table (on a relational database) surrounded by dimension tables (star schema), and when they talk about how the attributes on hierarchies are assigned on the dimensions on the multidimensional databse
@AaronBertrand because laziness
 
@Lamak Right, can you please go on with your explanation then? Thanks
 
@LewsTherin that's basically it. You have this "attributes" that you can use to slice your "measures", always thinking about performing some aggregation on them
so you can easily see the sales by city and year and month and not waiting hours to get those results
 
8:51 PM
Um... that sounds as if a multi dimensional table is based on a star schema.
 
@LewsTherin there are no tables there, forget about those things :-)
 
Oops sorry I meant database.. but if there are no tables.. what is it? Can you design a quick example of multi dimensional table
 
@AaronBertrand Because people are lazy. Typing ORDER BY takes to much effort.
 
@AaronBertrand but what if ORDER BY Doesn't work. I heard it doesn't sometimes :)
6
 
I just found this: alphadevx.com/a/…
I don't get that cube at all
 
8:54 PM
@LewsTherin nope, you could think that the data from that the multidimensional database use as a source are tables, but the result is a cube with dimensions :-)
@LewsTherin try not to give it a physical interpretation, at least not literally
 
Ok, that is going over my head trying to understand the structure. But what makes this cube faster?
 
@LewsTherin magic
 
lol
If only there were such a thing.
 
and the way the data is physically stored was designed for it. And the fact that you need to process the cube first
 
processing the cube pre-aggregates the data
 
8:57 PM
(not always, but let's assume that we are talking about MOLAP)
 
Oh yeah.. that's right. It is pre-processed already..
 
@LewsTherin right
 
@LewsTherin Do you know what Pivot is?
 

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