Finding rows that are missing specific value in a set

The database that I am using is MySQL. I have an options table that roughly looks like this

id          int(10) PRIMARY annex_id    int(10) title       varchar(255) sort_order  INT(10) NOT NULL 

Every annex (annex_id) has bunch of options enumerated by sort_order column which varies from 1 to N and are controlled by humans.

Due to software bug from a couple of months a lot of annexes do not have an option with sort_order == 1 but rather start from 2 or 3.

What I want to do is get all the annex_id‘s which contain options that do not have sort_order == 1. I’ll show an exemplary table because I feel like I’m explaining it wrong (which could be the reason I can’t come up with a query for it and I’ve been at it for hours).

ID Annex ID Title Sort Order
12 567 Title #1 1
13 567 Title #2 2
14 567 Title #3 3
15 890 Another title #1 2
16 890 Another title #2 3

From the given table I pretty much want craft a query that would get annex id 890 because it doesn’t have a row with sort order == 1.

The table has hundreds of thousands of rows and going at it by hand is insane. I’ve been dealing with databases for years and either I’m overthinking it or idk what but I can’t come up with an efficient query to do this job.

Is it even possible to have a query like this?

How to run php code only for a specific widget on a page and not all widgets on that page?

I want to display extra information below the post title only for the posts widget on the home page and not the portfolio widget. I’m using WordPress’ the_title filter to do this and that works fine, but at the moment, it shows the extra info in both the portfolio and the posts widgets. I need a condition to restrict the filtering only to the posts widget. The post widget’s class name is "home-post-widget"

My current code looks like this.

function add_rating_html( $  title) {      if (in_the_loop()){         $  out = "Rating: 5";         $  title .= $  out;     }     return $  title; }  add_filter('the_title', 'add_rating_html',1);  

Any help would be most appreciated.

How to filter and get specific keys from JSON objects array

I have a JSONB field containing a value in this structure:

[     {         "type": "small",         "name": "Josh",         "greeting": "Hello buddy!",         "hobby": "billiards",         "place": "Barcelona"     },     {         "type": "big",         "name": "Aziz",         "greeting": "Hey man!",         "hobby": "tennis",         "place": "Montpellier"     } ] 

I want to include this output if type is equal to "big":

{     "greeting": "Hey man! How're you doing Aziz?",     "place": "Montpellier" } 
  1. In the first row, I combined two values into one with some additional words.
  2. I don’t want my whole output to be empty if there isn’t type value equal to "big". Instead, output values of type value equal to "small" as a fallback.
  3. If there is not a fallback with type equal to "small", then output an empty string or NULL value but without Nulling the whole query result. Or preferably, not include these keys if no value is present.

I know I can combine values into one by using CONCAT but don’t know how to build this query and integrate it. I can’t loop through the array and output the values of the object that matches my filter. Tried CASE but still wasn’t able to get the result I want.

I use PostgreSQL 13.

(Unity 3D) How to make Player consistently jump *to* a specific target rather than *towards* it?

I’m trying to make it so if my player hits "E" then they jump precisely to a specific target. The current code results in player jumping towards the target but not really making it there.

I’ve tried adjusting forceMultiply and ForceMode and adding an offset but I just can’t get a result that simply consistently launches the player’s rigidbody rb towards the anchorPoint position.

The code I have is:

private void Update() {     if (Input.GetKeyDown(KeyCode.E))     {         tryGrabbing = true;     } }  private void FixedUpdate() {     if (tryGrabbing)     {         rb.AddForce(anchorPoint.transform.position * forceMultiply, ForceMode.Impulse);     } } 

Thank you for any help!!

Is it possible to do partial fraction expansion with specific degree of the variable?

For example, here is a rational polynomial: $ $ \frac{8 z^2}{8 z^2-6 z+1}$ $

If I using Apart directly, the result is: $ $ -\frac{1}{4 z-1}+\frac{2}{2 z-1}+1$ $ but if I want to using $ z^{-1}$ as the variable, the partial fraction expansion should be: $ $ \frac{-1}{1-\frac{1}{4}z^{-1}}+\frac{2}{1-\frac{1}{2}z^{-1}}$ $ Is this possible in Mathematica?

Prevent search engines from indexing specific elements on a site

A website I’m working on has a team section. Every team member has a dedicated site. On the site’s bottom of each team member three other team members are displayed randomly.

Site

What happens here is that search engines index all four images. When I enter the name a specific team member into a search engine I get all four images as results. I want to show only the main image on top. So, how can I prevent search engines from indexing the three images at the bottom?

Choosing a specific future date using Microsoft Dynamics CRM Advanced Search

Is it possible to use the advanced filter to select a specific future date, dynamically? For example if I want to return all data with a "date" field populated for 30 days from today, but no data from before or after that? From what I am seeing the only filter option similar is "Next X Days" but it’s inclusive of all days to that point.