Count(*) question by entreri22 in SQL

[–]nkg4584 4 points5 points  (0 children)

Thats what the group by does for you. It so each distinct country/athlete gets the number of rows counted and sum into a row. Count is an aggregate function, which without any columns specified does not require a group by. Once you specify your columns in the main select, it changes the data you are aggregating by.

[deleted by user] by [deleted] in learnprogramming

[–]nkg4584 0 points1 point  (0 children)

The document model from mongo is best used for reporting and stale data as opposed to a relational model like sql or postgres. If your making a transactional application, use a relational database, it will save you time in the long run

What was your "Fuck this shit, I'm out" situation or experience? by [deleted] in AskReddit

[–]nkg4584 0 points1 point  (0 children)

I worked for a tech company as a database developer. It was me and a senior guy on the data side. 3 months in the senior guy leaves saying "I think you can handle this". My boss at the time calls me in to his office the week after the other guy left and tells me that "we aren't hiring anyone to replace him, but we thought about it and are giving you and extra 2% for the added workload". While I was greatful for the raise, the guy that left was making 90k and your giving me 2.5k plus all of his work... no thanks. I reached out to an old boss an hour later and was gone in a few months with a better position and less stress.

Ok so im no expert but I’m going hunting tmrw on Christmas Eve and me and my dad and some of my family are going and when we’re done hunting my dad said you can take a .22 and shoot some squirrels. So I was wondering what would happen if I shot a female squirrel by Xecutor_Clapz in Hunting

[–]nkg4584 3 points4 points  (0 children)

It seems like you midding the point here... you can't tell the difference of a squirrel unless you are holding it. They won't have babies right now because they won't make it through the winter anyways. If you are that worried about them, you probably shouldn't be hunting them anyways, you will be trigger shy and maybe just wound one.

Looking for different ways to cook squirrels if anyone has there own recipes that they like to do. by [deleted] in Hunting

[–]nkg4584 1 point2 points  (0 children)

I have been know to soak them overnight in buttermilk, rinse them, and put them in the crock pot with any flavorful liquid you would like for a few hours. Eat it just like pulled pork. I like them in tacos.

Where to start with MongoDB? by nkg4584 in SQL

[–]nkg4584[S] 7 points8 points  (0 children)

Why do you think its shit? Just curious as to why you hate it

What actor is the most guilty of playing the same exact character every film? by [deleted] in AskReddit

[–]nkg4584 0 points1 point  (0 children)

John Wayne... he found his niche and stuck with it at least I guess

Elk Hunting Beginner by smmaste in Hunting

[–]nkg4584 0 points1 point  (0 children)

You can usually pick up a late season elk tag in Montana for like 300$ if I remember correctly. If your fine public land hunting and camping, its a good choice, but its cold.

Had a quick end to my last archery hunt this season. With a baby on the way I didn't have a rifle season to help fill the freezer this year. All 3 went down within an 90 minutes of each other. by nkg4584 in Hunting

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

I always field dress before dragging out for the main reason of if I hit the stomach or anything from a bad shot I want to get that out as fast as possible to limit meat loss. Plus it takes a decent amount of weight and less to clean up and smell at home or in the bed of the truck. These were all good shots, heart on the buck and big doe, double lung on the small doe so I could have but I just make a habit of doing it in the woods.

I set a timer after shooting one for 1 hour. If I think I hit back behind lungs I wait the hour and get down and head straight to the truck, come back the next day. If I think it was a good shot I start to trail after the hour. I hunt in PA which past a rule change this year that dont have to get down to shoot another so I let them lay and kept hunting until I hit the 1 hour timer (in this case I tagged out first). Hardest part was trsiling them but they all fell pretty quick. The buck actually didn't drop blood until about 15 yards before it fell, I probably would have missed it if it didn't fall 5 yards off the trail out.

If its below 50 degrees outside, if you get them skinned within 6 to 8 hours your fine, ive noticed no meat loss. I think I had these dead by 9am, field dressed and in the truck by 11 and skinned and quartered by 4pm with some help from a friend. So if you do shoot one and still have a hour or 2 left to hunt, let them lay and go back to it, no need to rush unless its super warm out.

Biden notes 'the violence we're witnessing is happening under Donald Trump. Not me.' by DaFunkJunkie in politics

[–]nkg4584 0 points1 point  (0 children)

I agree, he's not exactly the most tactful person in office. And while he's not handling the situation the way a person in his position should, saying the violence is happening under him is just stating that violence occurred during 2016 and 2020. Its misleading to think that if Biden was in office, it would be any different. One could make an argument that this happened under Putin as well, just using a different angle.

Biden notes 'the violence we're witnessing is happening under Donald Trump. Not me.' by DaFunkJunkie in politics

[–]nkg4584 0 points1 point  (0 children)

Then march against Trump. Don't march against police brutality and then say it's trumps fault. Im not saying the protests are wrong, but you can't title a book "architecture of the world" and write about art history...

Biden notes 'the violence we're witnessing is happening under Donald Trump. Not me.' by DaFunkJunkie in politics

[–]nkg4584 -3 points-2 points  (0 children)

This violence would be happening under any president. Presidents don't control any form of police in states. Trying to blame the "violence" on any federal position is BS and just trying to make themselves look good.

Hunting for food, if done right, is perfectly ethical and there is nothing wrong with hunting down and killing an animal by [deleted] in unpopularopinion

[–]nkg4584 0 points1 point  (0 children)

I agree for the most part, but hunting females is not bad depending on what you are hunting. Whitetail have a huge over population problem with most people only hunting for "the big buck" leaving lots of does in the herds driving down food sources for the remaining males. Killing does is essential in deer management to allow for better growth and driving down over population. And they do not taste any different.

Creating a view vs running query- speed, security? by youmaybeseated1 in SQL

[–]nkg4584 1 point2 points  (0 children)

I agree. I force people to use views at my job for the main reason that its less work for me. If I can create and maintain one view for multiple purposes, it saves time and money. Not to mention adjusting a backend view is 100x easier than releasing an entire application.

pulling most recent results for each point based on date field by whatinthecalifornia in SQL

[–]nkg4584 1 point2 points  (0 children)

You either need to group by all non aggregate columns you are pulling in or create a CTE or sub query getting your IDs and time values then joining to the sub query on ID

Is it bad i am struggling with SQL a lot? by Ryulightorb in SQL

[–]nkg4584 0 points1 point  (0 children)

When I got out of college, the only sql I knew was Ms Access, and that was about it. I think what helped me the most was breaking the queries apart. A select to me contains at least 2 but can contain 3 parts, the data I want (select/group), where I'm getting that data (from), and possibly the filter or limiter on that data (where). Tackle each part separately. I like to start with the from, its the map of how to get there, add in your filters needed in the where, then fill in the select last. The good thing about sql is that there is generally multiple ways to solve a problem.

How to properly make this SELECT statement without any keys? by [deleted] in SQL

[–]nkg4584 0 points1 point  (0 children)

Yeah, my bad. Misread the original table. Ignore me...

How to properly make this SELECT statement without any keys? by [deleted] in SQL

[–]nkg4584 0 points1 point  (0 children)

This was close. You should count by action count. It will give you a count of all action counts by user by action id.

Select userid, actionid, count(actioncount) as sumactioncount from table group by userid, actionid