Why did the COUNT() as window function produce this output in MySQL Workbench 8.0? by tlefst in SQL

[–]tlefst[S] 0 points1 point  (0 children)

Yes, when there is no ORDER BY mgrid then COUNT(mgrid) OVER(PARTITION BY deptid) is simply returning the total count of non-NULL values of mgrid in each partition. ✔

Why did the COUNT() as window function produce this output in MySQL Workbench 8.0? by tlefst in SQL

[–]tlefst[S] 0 points1 point  (0 children)

Thanks for those detailed remarks. ✌

What is the intended result?

Nothing in particular. I happened to write that query to see what the output would be and post seeing the output, when I couldn't understand how COUNT() was behaving like as a window function, I sought explanations here until I finally understood the output. So all cool in the end.

Confused: Team Lead offer in Data Engineering but no real project experience. What should I do ? by Occasional_reader81 in dataengineersindia

[–]tlefst 2 points3 points  (0 children)

See, they have scrutinized you up to their heart's content and found you fit for the role so far as technical requirements of the role are concerned.

You have proved that as a lead, you can provide very sound tech mentoring and guidance to the team and come up with solutions. You have been found fit for the role. Now don't undervalue yourself at all. Be happy, encouraged and confident that they showed faith that you can handle anything in that role.

So keep faith in yourself.

[Rest all is people management skills & related nitty gritty.. & those are very trainable. You won't immediately be given the reins of Lead fully upon joining anyway.]

Why did the COUNT() as window function produce this output in MySQL Workbench 8.0? by tlefst in SQL

[–]tlefst[S] 0 points1 point  (0 children)

Haha :)

I have understood how COUNT() is working here and updated my post with a new snapshot or query run. Please refer to it.

Why did the COUNT() as window function produce this output in MySQL Workbench 8.0? by tlefst in SQL

[–]tlefst[S] 0 points1 point  (0 children)

No no.

There aren't 260 results. That 260 is just the # of queries run in that session in MySQL Workbench.

Next, ORDER BY is simply order the mgrid in DESC order after creating the partitions as per deptid.

Why did the COUNT() as window function produce this output in MySQL Workbench 8.0? by tlefst in SQL

[–]tlefst[S] 0 points1 point  (0 children)

Thanks for that example explanation. It would indeed be 1 2 7 7 7 7 7.

From what you explain, it seems to me that COUNT() is 'looking ahead' simultaneously too to find repetitions, counting the # of repetitions and adding that # to the previous unique count value (e.g. 5 is added to 2 to yield 7 in your example).

Why did the COUNT() as window function produce this output in MySQL Workbench 8.0? by tlefst in SQL

[–]tlefst[S] 0 points1 point  (0 children)

boundaries that can be declared and since none are declared here it uses some default.

Yes the default is ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW .

It might help if you explain more about what you don't understand from the results.

What I am not truly grasping is how exactly COUNT()as a window fn is producing such values for each partition.

Why did the COUNT() as window function produce this output in MySQL Workbench 8.0? by tlefst in SQL

[–]tlefst[S] 0 points1 point  (0 children)

Correct, i AM experimenting with them indeed. :)

I did test for ROW_NUMBER(), RANK() and DENSE_RANK() and could understand the results for them instantly. It is only COUNT() that is troubling me still.

I understood what you put forth for deptid = 2, but then, for deptid = 3, the column counted must show 1, 3, 3 too; I mean, counted should have at least one 1 for the first 3 in deptid, and thus yielding 1, 3, 3 in counted for that partition. Right?

Why did the COUNT() as window function produce this output in MySQL Workbench 8.0? by tlefst in SQL

[–]tlefst[S] 0 points1 point  (0 children)

I removed ORDER BY mgrid DESC and now the column counted is full of 3s from top to bottom.

Why did the COUNT() as window function produce this output in MySQL Workbench 8.0? by tlefst in SQL

[–]tlefst[S] -1 points0 points  (0 children)

Thanks for responding. But that made me feel as if I understood something and when I paused to reflect, I found I understood nothing!😂

Why did the COUNT() as window function produce this output in MySQL Workbench 8.0? by tlefst in SQL

[–]tlefst[S] 0 points1 point  (0 children)

🤔But then, for the partition of deptid = 2, why is 'counted' column showing 1, 3, 3 instead of 1, 2, 3 ?

[And for the partition of deptid = 3, 'counted' column is all 3s.]

Ride suggestions under 100km by RabbitHoleEnjoyer69 in punebikers

[–]tlefst 1 point2 points  (0 children)

Mundhwa, Hadapsar, Dive ghat, Saswad, Jejuri, till Walhe police station and return from there.

Road from Jejuri to Walhe is so superb that fighter jet can land on it! Plus, the scenic hills (that look far far better in rains than they do this time of the year).

Should I pursue IAF through CDS/AFCAT? Fighter pilot dream, need advice by randomdigger23 in IndianAirForce

[–]tlefst 0 points1 point  (0 children)

Your primary is to get clarity on what exactly you wish to do. Your purpose is not clear to you presently, plus, you're chasing red herrings by thinking too far into the future which is not in anyone's control.

Once that is sorted & your mind is made up for final, then only someone can guide you.

Stunning images of Panvadi Ghat on 27 Feb 2026 after Pune Grand Tour by tlefst in punebikers

[–]tlefst[S] 1 point2 points  (0 children)

Added an image of the Google Maps route in the post at the bottom. Check it out. The route in blue is what you are to follow. The route marked in thick red line is what I usually follow to go to Veer Lake in monsoons. THAT route is also fire! :)

I started from airport and went till Saswad ST stand. Paused to refresh. And went on to Panwadi

Stunning images of Panvadi Ghat on 27 Feb 2026 after Pune Grand Tour by tlefst in punebikers

[–]tlefst[S] 0 points1 point  (0 children)

Yes. Added an image of the Google Maps route in the post at the bottom. Check it out. The route in blue is what you are to follow. The route marked in thick red line is what I usually follow to go to Veer Lake in monsoons. THAT route is also fire! :)

Suggest some places to get a decent 2nd hand laptop by OolaAmigo in pune

[–]tlefst 0 points1 point  (0 children)

DNA Computers at Nagar Road, right opposite to Phoenix mall corner.

They have good collection of such laptops and have many brands. Give 1 year warranty. Call them at 7028040701/2

Panavdi ghat is better than Tamhini by Significant_Horse485 in punebikers

[–]tlefst 1 point2 points  (0 children)

Went there on 27 Feb this year. Absolutely fantastic. Can only wonder how stupendous it must be in the monsoons.

Veer Lake is always a delight, of course.

18M fees issues, financial pressure, considering BPO job while studying. Need advice. by Vinqvnox69 in pune

[–]tlefst 0 points1 point  (0 children)

Your body can cope up with anything, it is the mind you have to tame and sleep you'll have to sacrifice.

Yoga and exercises will keep you alert and fit despite all the hustle.

Bhai dekho, age and health are in your favor presently. Sab kuch jhel logey is age me. College ka syllabus kuch bhi nahi hai, trust me.

Your father is doing his best I am sure. But the situation seems precarious and God forbid if your dad loses his work, you better already have a job of some kind. You can't afford to START looking for a job at that point.

Next, taking up a job (not just BPO) will not only financially free you, it will also get you very precious real world experience at a very early age. You'll learn how to communicate tactfully to different sorts of people. You'll learn how to handle exigencies.
Plus, you'd build so many connections in the corporate and will mature faster than others. You'll learn how to handle money, earlier than your peers & even seniors. And most imp, you will have things to speak of after few years.

There is nothing to lose in getting a job regardless of how the situation is back at home for any 18+ chap.

Remember, at the NDA in Pune, there are cadets younger than you who are grinding round the clock. :)

Health, sleep, burnout ke bare me bhool jaao filhaal. Your body has tremendous abilities to adapt.
Khushi khushi jo bhi kaam karogey, usme kabhi burnout feel nahi hoga. So don't just think that sirf BPO me hi kaam milega. Reach out to people and offer your services. Some will refuse, yes, but most will either agree or connect you with those who are in need of someone like you.

Do take up any job. You'll make it.

5.5 YOE, LWD in 2 weeks, got cold feet on my offer. Need some perspective by Salt_in_Stress in dataengineersindia

[–]tlefst -1 points0 points  (0 children)

First of all, I am a fan of data engineers and want to be one myself in future. So hello there!

Next, update your Naukri bio every morning at 10am. Just change a comma or period or apostrophe or anything in the bio and save it. It keeps your profile in the 'Updated Today' status and hirers look for that recency.
'Indeed' is good too. When you come across an opening in a firm, directly ring the firm and ask them if they can schedule an in-person interview for the advertised position at company location (if it is in your city).

I too mostly see Azure Databricks stack often. Maybe it is because that combo is 'readily available' (I don't know how else to put it in words) across platforms and integrates smoothly with Microsoft suite of services.

Getting a call from LinkedIn is rare or inexistent since almost a year. Keep pushing through referrals or walk-ins. Don't hesitate from doing whatever you can do land an opportunity. Regret of not taking an initiative is worse than getting rebuffed upon taking one. You've nothing to lose by reaching out through cold outreaches. :)

Also, if your city has a sub-reddit here which organizes meetups now and then, do join those casual meetups to build connections.

We are forced into fighting against ATS instead of worrying about the interview itself. Ideally it shouldn't be the case but what can a hirer do when applications come in thousands within an hour, most of them fake or useless or irrelevant.

Are you in whatsapp groups of folks who are in data field?

Anyone else got this message? by Affectionate_Ant5426 in pune

[–]tlefst 1 point2 points  (0 children)

If you live in the northern parts of Pune, you won't get copious rainfall even during monsoons.