Timeline for Count of 3 consecutive unsynced dates
Current License: CC BY-SA 3.0
19 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 30, 2015 at 20:29 | vote | accept | Jay | ||
Jan 30, 2015 at 20:12 | comment | added | Jay | @ErwinBrandstetter Added some more details | |
Jan 30, 2015 at 20:12 | answer | added | Erwin Brandstetter | timeline score: 2 | |
Jan 30, 2015 at 20:11 | history | edited | Jay | CC BY-SA 3.0 |
added 199 characters in body
|
Jan 30, 2015 at 20:06 | history | edited | Erwin Brandstetter | CC BY-SA 3.0 |
use the_date instead of date, clean up, add tags
|
Jan 30, 2015 at 19:57 | comment | added | Erwin Brandstetter |
What would you do with 5 consecutive 0? Count as 1, as 3 or something else? Also, is (user_id, date) unique? (IOW: max 1 entry per user and day?) Please clarify the question.
|
|
Jan 30, 2015 at 19:51 | history | edited | Jay | CC BY-SA 3.0 |
deleted 1 character in body
|
Jan 30, 2015 at 19:50 | comment | added | Jay | @Vérace Ah, I just output the schema from my Rails app and it gave me that create table back. However, it appears that the incrementing is handled by a created sequence. | |
Jan 30, 2015 at 19:46 | comment | added | Vérace | id integer NOT NULL, should be id serial NOT NULL, otherwise it's not auto_incrementing in MySQL parlance (or a sequence in Oracle lingo). Try it. | |
Jan 30, 2015 at 19:42 | comment | added | Jay | @Vérace Serial for which column? And yeah, fair point on the field names! | |
Jan 30, 2015 at 19:39 | comment | added | Vérace | You should have used "serial" instead of "integer" - your SQL fails otherwise. Second (pet peeve coming up!), could you please not use SQL keywords as table or field names - it makes typos/errors difficult to track down, plus if you wish to migrate in the future, you'll be scr**ed. :-) | |
Jan 30, 2015 at 19:07 | comment | added | Jay | @Vérace Create Table, Insert Into added. Thanks for pointing me to the links. | |
Jan 30, 2015 at 19:06 | history | edited | Jay | CC BY-SA 3.0 |
edited body
|
Jan 30, 2015 at 18:55 | history | edited | Jay | CC BY-SA 3.0 |
edited body
|
Jan 30, 2015 at 18:55 | comment | added | Jay | @Vérace Yep typo sorry. | |
Jan 30, 2015 at 18:53 | comment | added | Vérace | By my reckoning, the answer is only 2 - in the final 3 zeros, two of them occur on the same date, not consecutive ones (2015-01-06). Typo? Also, could you provide DDL (CREATE TABLE (user_id INT...)) and also DML (INSERT INTO TABLE Blah VALUES(....). This makes it far easier for people to help you - plus you're more likely to get good answers quickly. Check out the tour and the "help us to help you blog" (both at bottom of screen). BTW, welcome to the site. | |
Jan 30, 2015 at 18:53 | comment | added | LowlyDBA - John M | You may want to start with this similar question. | |
Jan 30, 2015 at 18:46 | review | First posts | |||
Jan 30, 2015 at 18:51 | |||||
Jan 30, 2015 at 18:45 | history | asked | Jay | CC BY-SA 3.0 |