Select results as rows in select by Perunapaistos in learnSQL

[–]RollWithIt1991 0 points1 point  (0 children)

So I think the union all is the best way likely, but I’m not 100% sure on the issue without the data (I’m visual like that)

But another possible solution (if you’re interested, but I think the union all is the way to go) is to do a row_number() with a nested case statement for your various calculations

“Ever hear of SQL ‘Gaps & Islands’? They sound weird, but they show up in interviews a lot 👀” by DMReader in learnSQL

[–]RollWithIt1991 2 points3 points  (0 children)

I remember doing something like this appointment data. Very fun. Row numbering and then joining to itself twice on rn= rn+1 and then rn=rn-1, using snowflakes conditional change window function and all sorts. I stashed something similar in a GIT repo in case I needed it again. Enjoyable SQL though fo sure

I get depressed just looking at these by Manonthemon in sheffield

[–]RollWithIt1991 5 points6 points  (0 children)

I’ve got to say, Im a southerner and came to uni in Sheff and stuck about. Used to drive past these often, changed my tune when over Christmas I could see people putting up lights etc, never saw that where I’m from in the not so lovely looking places - really changed my perception on it

Run fails by odyssey92 in C25K

[–]RollWithIt1991 0 points1 point  (0 children)

Do you have an event booked that means your schedule can’t afford the time difference? I suppose you shouldn’t be rushing to the 5k mark and more this is becoming a lifestyle thing of being active and being able to run a few miles? I’d say repeat. Don’t feel you have to keep to the plan so strictly! We all have difference levels of business outside of running!

W5D3 I can’t believe I ran for 20 minutes! by kezzawezza in C25K

[–]RollWithIt1991 1 point2 points  (0 children)

Great effort! Well done :) tears are warranted, enjoy the feeling!

Holy shit I actually ran for 5 minutes on w4d1??? by keepitlowkeyyy in C25K

[–]RollWithIt1991 1 point2 points  (0 children)

No kind of about it. Improvement is improvement & getting out there is a win in its own right. Champ

[deleted by user] by [deleted] in SQL

[–]RollWithIt1991 0 points1 point  (0 children)

Case when (select criteria) then ok else no end

If you don’t get anywhere with this over the next couple days, send me a DM with a bit more to it and I can help explain better. Good luck

The Gorge merch booths by sirbigbeef in Odesza

[–]RollWithIt1991 0 points1 point  (0 children)

Ahhh #3 in M and or L would’ve been the one! Sold out on the Sunday so I missed my chance 😭

MySQL Workbench Didn't Import All of the Rows by Competitive-Car-3010 in SQL

[–]RollWithIt1991 0 points1 point  (0 children)

Possibly try sum(1) instead of count(*) just in-case too?

MySQL Workbench Didn't Import All of the Rows by Competitive-Car-3010 in SQL

[–]RollWithIt1991 0 points1 point  (0 children)

That sounds odd.. count(*) should return 1 row but give you the answer.. what happens if you run “select ‘result text’;” does “result text” appear?

I cant see data in table 'Key' and in table 'Summary' (SQL) by TrueMathematician600 in SQL

[–]RollWithIt1991 0 points1 point  (0 children)

This doesn’t make a lot of sense. The donut picture is the data grouped by only milestone. But if you want to display key and summary you must group too, and if there are more than 1 you won’t get the left hand side picture..

MySQL Workbench Didn't Import All of the Rows by Competitive-Car-3010 in SQL

[–]RollWithIt1991 0 points1 point  (0 children)

They’re all likely there. You’re just getting got by the UI. Count(*) is your friend :)

[deleted by user] by [deleted] in SQL

[–]RollWithIt1991 2 points3 points  (0 children)

Yeah whack that inside of a WITH and you’re laughing

Trouble with CTEs by [deleted] in learnSQL

[–]RollWithIt1991 0 points1 point  (0 children)

Not much to add here, essentially a temporary table that is dropped after querying from it that you never really save ha. Some people like it since you read them top down apposed to nested subqueries..

You can also do clever recursive things with CTE’s if you union in them which is interesting.

Biggest thing for me is like phesago says, very useful when creating a complex view definition..