4 ms·
Tell me which is more likely to be a sum of profits for years since 2013. Excel: SUM(A100:A112) SQL: SELECT SUM(yp.profit) FROM yearly_pro
by yummyfajitas 14y ago
Tell me which is more likely to be a sum of profits for years since 2013. Excel:
SUM(A100:A112)
SQL:
SELECT SUM(yp.profit)
FROM yearly_profitability AS yp
WHERE yp.year > '2012-12-31'::Datetime
(I'm forgetting how to do SQL datetimes, but whatever.)
SQL and other programming languages use words to describe the variables. Treating SQL like Excel would be DailyWTF material:
CREATE TABLE sheet1(
a INTEGER,
b TIMESTAMP WITH TIME ZONE
)
- UnoriginalGuy 14y agoI hate it when people generate these contrived examples where they intentionally stack the scenario to favour whichever way proves their point the most. Which is easier to understand: =SUM(profits01_2012:profits12_2012) Or: SELECT * FROM dassaddasads WHERE date > 1325394000 AND date < 1356930000 Which is easier to understand?!
- deleted 14y ago[deleted]
- InclinedPlane 14y agoThis ignores the common use case. yummyfajitas' examples were exceedingly stereotypical of both excel and mysql usage.
- UnoriginalGuy 14y agoThey aren't stereotypical of the kind of Excel that gets written by people who use it as a major part of their job. They're stereotypical of people writing poor Excel queries against unnamed cells via location reference.
- dspeyer 14y agoIs that first one valid Excel? I've never seen it before.
- UnoriginalGuy 14y agoYes, it is valid Excel. Naming cells is something they teach in beginners courses. http://www.computerhope.com/issues/ch000704.htm http://www.computerhope.com/issues/ch000704.htm http://support.microsoft.com/kb/274504 http://support.microsoft.com/kb/274504
- omni 14y agoI have seen literally hundreds of Excel spreadsheets from banks, consultancies, and VC firms and I have never, ever seen anyone name individual cells the way you are proposing here. If I had to name individual cells in a monthly model spanning the next 10 years over 250 line items, I'd quit that job. I'm not saying that Excel can't do it, but a) it sounds like it would take a huge amount of time, so b) it is not practically done in "the real world."
- jodrellblank 14y agoIf I had to name individual cells in a monthly model spanning the next 10 years over 250 line items, I'd quit that job. Why would you quit the job over a few minutes of scripting with "WorkSheet.Names.Add"? http://msdn.microsoft.com/en-us/library/office/ff835300.aspx http://msdn.microsoft.com/en-us/library/office/ff835300.aspx
- deleted 14y ago[deleted]