Can a half-elf taking Elf Atavism select a versatile heritage?

As title. Consider Halledon Felf, a half-elf. At first level, Hal takes Human ancestry, and selects Half-elf as a heritage. He then has an ancestry feat, which he uses to take Elf Atavism, allowing him to select an Elven heritage.

Leaving aside for a moment whether it benefits Hal to do so, can Hal select a versatile heritage, such as Aasimar or Tiefling, RAW?

PostgreSQL. Consequently select results according with specific filters

I have a table with users.

User (that uses this programm) can select users by applying different filters. A filters must be applying immediatelly to reduce search time in final SELECT and no wasting time.

Currently my code looking like this (Python, not sure that this is working, not tested yet).

The question:

  1. How to applying a filters immediatelly as I get a user input?
  2. How to put/pass all actions related to filtering to DB?
if only_with_photo:     cursor.execute('SELECT tg_user_id FROM suers WHERE photo IS NOT NULL')     users_with_photo = cursor.fetchall() if only_with_country:     cursor.execute('SELECT tg_user_id FROM suers WHERE country IS NOT NULL')     users_with_country = cursor.fetchall() if only_with_city:     cursor.execute('SELECT tg_user_id FROM suers WHERE city IS NOT NULL')     users_with_city = cursor.fetchall()          cursor.execute('SELECT tg_user_id FROM users WHERE tg_user_id IN (users_with_photo) AND tg_user_id                              IN (users_with_country ) AND tg_user_id IN (users_with_city) ) 

Tasks: perform this queries inside psql without using Python or another language?

I tried:

  1. CASE sql = 'SELECT (CASE only_with_photo = 1 THEN (SELECT tg_user_id FROM users WHERE country IS NOT NULL)' --Subrequest returns more that one result
  2. Variables /set only_with_photo := (SELECT tg_user_id FROM users WHERE birthdate IS NOT NULL); --Syntax just now working

Evenly select Records on categorical column with Repeating Sequence and pagination in Postgres

Database: Postgres
I have a product(id, title, source, ...) table which contains almost 500K records. An example of data is:

| Id | title    | source   | |:---|---------:|:--------:| | 1  | product1 | source1  | | 2  | product2 | source1  | | 3  | product3 | source1  | | 4  | product4 | source1  | | .  | ........ | source1  | | .  | ........ | source2  | | x  | productx | source2  | |x+n |productX+n| sourceN  | 

There are are 5 distinct source values. And all records have source values random.

I need to get paginated results in such a way that: If I need to select 20 products then the results set should contain results equally distributed based on source and should be in a repeating sequence. 2 products from each source till the last source and again next 2 products from each source. For example:

| #  | title    | source   | |:---|---------:|:--------:| | 1  | product1 | source1  | | 2  | product2 | source1  | | 3  | product3 | source2  | | 4  | product4 | source2  | | 5  | product5 | source3  | | 6  | product6 | source3  | | 7  | product7 | source4  | | 8  | product8 | source4  | | 9  | product9 | source5  | | 10 |product10 | source5  | | 11 | ........ | source1  | | 12 | ........ | source1  | | 13 | ........ | source2  | | 14 | ........ | source2  | | .. | ........ | .......  | | 20 | ........ | source5  | 

What is the optimized PgSql query to achieve the above scenario considering the LIMIT, OFFSET, sources can increase or decrease?

how to allow user select shipping location(a custom locations dropdown) in checkout and recalculate values woocommerce

i need to know 2 things

  1. how do i add custom shipping zones to a determinate contry (I need to add some neightbours of a main city)
  2. How do i allow users to select the shipping zone when chekout or in the cart, and recalculate the total

Get_option use inside switch select option

I try to make inside theme custom admin panel a switch select option. but i cannot get the value of switch case. following is my code:

$  bannerchange = $  _POST['bannerchange'];  if( get_option('bannerchange') != get_option($  bannerchange)) {             $  bannerchange = update_option( 'bannerchange', get_option($  bannerchange));  }  <?php if(isset($  _POST['wphw_submit']) && $  chk):?>   <div id="message" class="updated below-h2">     <p>Content updated successfully</p>   </div>     <?php endif;?>       <form method="post" action="">  <select name="wphw_submit" onchange="this.form.submit()">      <option value="page1"<?php if ($  bannerchange == "page1") { echo " selected"; } ?>>Custom Departure</option>      <option value="page2"<?php if ($  bannerchange  == "page2") { echo " selected"; } ?>>Fixed Departure</option> </select> <noscript><input type="submit" value="Submit"></noscript>  </div> <input type="submit" name="wphw_submit" value="Save changes" class="button-primary" /> <?php  switch ($  bannerchange) {     case 'page2': ?>                  <p>two</p>          <?php         break;     case 'page1':         ?>         <p>one</p>         <?php         break;     }     ?> 

$ bannerchange get always undefined.

Select arbitrary single value for GROUP BY: What’s the fastest option?

I have a query that I use to indicate locations in a map where there are overlapping points:

select     min(objectid) as min_objectid,     longitudex,     latitudey,     count(1) as count,     min(shape) as min_shape from     workorders group by     longitudex,     latitudey having     count(1) > 1 

In the mapping software that I use, I need to include columns like objectid and shape. For those columns, it doesn’t matter which of the grouped-by rows the values come from, just as long as there is a value.

Presently, I’m using min() to get an arbitrary value for those columns. However, I don’t know if that’s the fastest option since finding the minimum value would require calculation — and I wonder if that time spent is unnecessary.

What is the fastest option for getting an arbitrary/single value for GROUP BY in an Oracle query?

Disable auditing of select statements

Somehow the auditing of select statements was enabled in our oracle database. We have several data processing apps that are generating upwards of 15 GB per day in the audit trail. Now we cannot turn it off because it seems that the noaudit command needs to match the original audit command, which of course no one knows. Does anyone know how to undo this? Can we turn off all auditing and then turn on the usual assortment of audit actions (alter, create, drop, etc.)? We have ran all kinds of noaduit permutations: “noaudit select table by USER;” and “noaudit select any table;” and yet it still posts select statements to the audit trail.

Does commit after a normal select can call any fsync or flush operations?

Coms counts taken at particular time for all 3 (insert,update,commit).

Com_inserts are in 1.1K  Com_updates are in 1.6k  Com_commit are in  10K 

When enabling general log, I could see after each selects there is a commit. Would this unnecessary commit can cause any fsync or any flush opertation to the server?