ErikE

California

Age: 41

SQL Fiend.

Puzzle Lover.

Curious about almost everything.

1h
comment Javascript: Sort multi dimensional Array based on first arrays sort results
And you made sure it's a stable sort, too. +1.
5h
comment Create evenly spaced out sequence in SQL
So basically you want to create a smooth line going from the 5th %ile value to the 95th, having 100 steps between them? Is it possible that you really want 90 steps (so that each step could represent a %ile point)?
5h
revised Return id where count of value associated with that id on other table is 0
deleted 4 characters in body
5h
comment Return id where count of value associated with that id on other table is 0
You're right, sorry about that. I scanned too fast.
5h
revised Return id where count of value associated with that id on other table is 0
added 220 characters in body
5h
answered Return id where count of value associated with that id on other table is 0
7h
comment Alternative term to "Blacklist" and "Whitelist"
They only "sound strange" to [insulting term for a class of people lacking an important personal attribute]. Seriously. Soon we won't be able to say niggardly, denigrate, or Nigeria or use the terms black heart, black/white knight, blacken one's name, black market, and so on! This is so pathetic. It's strikingly similar to the mother who wanted to name her daughter (rhymes with Regina) Vagina. Utter ignorance is driving this.
12h
comment Javascript: Sort multi dimensional Array based on first arrays sort results
@DavidTorno It works great, but I just can't resist saying that it's a band-aid on top of a less-than-optimal strategy of data storage.
12h
comment Javascript: Sort multi dimensional Array based on first arrays sort results
I'd give you +1 only I can't because your sort function tries to do math on string values... ?
1d
comment Javascript: Sort multi dimensional Array based on first arrays sort results
Just because you're populating a listbox GUI doesn't mean you have to have a multi-dimensional array. You could very easily rewrite your code to use an array of objects, ala [{col1:'d', col2:'ee'}, {col1:'a', col2:'rr'}, {col1:'b', col2:'mm'}, {col1:'c', col2:'yy'}]. This is in my mind a superior way to store the data and work with it for many reasons, not the least of which that then you can sort it and the related data stays together! It just doesn't make sense to put data into separate arrays, when elements are supposed to be correlated. Don't use nested arrays to store row-type data!
1d
comment SQL Delete and Update didn't delete and update
@retailcoder Additionally, if you open a transaction on a connection, you can issue many commands before you roll it back or commit it. So I really was thinking statement-level, not command-level.
1d
comment SQL Delete and Update didn't delete and update
@retailcoder Not exactly. A command execution can be turned by the provider into multiple statements, however, there is going to be at least one statement that performs the DML operation, and that statement is what I was thinking about. The provider is free to wrap the whole batch in a transaction if it wants--or not (and then each statement will auto-commit). Some DBMSes do require an explicit COMMIT; but MS Access, and yes, SQL Server, do not--if you don't begin a transaction, then the implicit tran begun by any statement is also auto-committed after executing that statement.
1d
comment SQL Delete and Update didn't delete and update
@retailcoder No explicit transaction is needed. Each statement has an implicit transaction.
1d
comment SQL Server: get records that their date is either begining or end of the month
It's perfectly valid, of course! I was just curious if you had a particular reason. The ability to include other columns made it seem to me a natural choice to avoid aggregates here. But no biggie! Ironically, my answer uses aggregates, too, (though in a way that lets me still include other columns). :)
1d
revised SQL to Parse a Key-Value String
edited tags
1d
answered SQL to Parse a Key-Value String
1d
comment SQL to Parse a Key-Value String
What version of SQL Server?
1d
comment SELECT a single field by ordered value
What version of SQL Server, please?
1d
comment SELECT a single field by ordered value
I think the original post had all the information you needed to understand the requirements, especially the part about "since student 2's latest score was above > 80."
1d
revised SELECT a single field by ordered value
added 576 characters in body
1 2 3 4 5