You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- 91@lucaswxp: If you write a special-case comparison for strings following a specific schema, you can of course make it as baroque as you want. The thing here is that the schema is designed such that lexical order (as well as lexical number-aware order) is also logical order, so no need for customizing.Deduplicator– Deduplicator2018-09-25 00:48:39 +00:00Commented Sep 25, 2018 at 0:48
- 19@lucaswxp Your date string might not be in memory. Practical example: You have a csv file already sorted by ISO date and millions+ of rows per year. And you want to return only the rows between certain dates. You can read the file line by line (row by row) until you reach your first date, then load rows into memory until you reach your last date. You can skip the rest of the file. But if you save the date as some other format, or sorted by year only, you would have to read trough the entire year worth of records before closing the file.emptyother– emptyother2018-09-25 05:00:22 +00:00Commented Sep 25, 2018 at 5:00
- 49Note that the dashes are optional in ISO 8601, so YYYYMMDD is ISO 8601.Martin Ba– Martin Ba2018-09-25 11:14:31 +00:00Commented Sep 25, 2018 at 11:14
- 33@Benoit A proposal has already been made to solve the Y10K problem. If we're still using the same era then, we'll go to AYYYYYMMDD until Y100K, which will be BYYYYYYMMDD, CYYYYYYYMMDD, DYYYYYYYYMMDD, EYYYYYYYYYMMDD. This leading alpha prefix assures correct sort order (provided that "A0YYYY..." etc. are invalid representations if any YYYY... dates are still used). At some point when the number of year digits are divisible by three, we'll start adding three digits each time we change alpha prefix, in order to assure we don't run out of letters before the heat death of the universe.Monty Harder– Monty Harder2018-09-25 15:00:00 +00:00Commented Sep 25, 2018 at 15:00
- 35It's important to note that with this format, sorting isn't just "easier." The lexical (character based) sort becomes equivalent to the temporal sort, which means you can sort temporally without parsing.jpmc26– jpmc262018-09-25 15:39:15 +00:00Commented Sep 25, 2018 at 15:39
| Show 19 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-sql