relational theory – same query, different result (depending on the permissions of the user)

A question about SQL in general:

If two users execute the same SQL statement, can User1 get different results than User2?

Imagine, User1 has more permissions than User2.

In other words, does User1 possibly receive 100 lines and User 2 only 80?

BTW: Which day fits this question?

SQL Server – Are table locks released after a query completes when WAITFOR is used after this query within the same batch and transaction?

If I have a query that is read from a table and that query is performed with the WAITFOR keyword (within the same batch and transaction), the previous query's table lock is retained until WAITFOR completes and the transaction completes? (I mean in the context of a Read Committed Isolation Level Server.)

Sample query:

BEGIN TRANSACTION

SELECT *
FROM ReallyLargeTable

WAITFOR DELAY '00:30';

COMMIT TRANSACTION

Does WAITFOR DELAY cause the previous query to hold the table lock for ReallyLargeTable for another 30 seconds until the delay has expired and the transaction has been committed?

Google Sheets: Counting query based on multiple conditions?

I have a table that I use for my World of Warcraft guild, and I stumbled against a wall when I tried to add new features to it.

For reference, when our guild goes through dungeons, we distribute objects that are dropped based on a plus counting system. That is, everyone starts at 0 and can roll against other 0 to try to win an item. If someone wins something, they receive +1 and can only roll against other +1s. So a person does not win everything just because they have more luck.

So we have a hand that records every single item that drops, who won it, where it was won, and if it counts to the + 1 system (there are some items that are not worth counting). Next to the item log is a query that automatically displays the number of items. This query looks like this:

Loot Tracker
--------------
Name     Count
--------------
Jim      2
Bob      1
Liam     1
Dave     1
Luke     1

The actual query for this is currently:

= INQUIRY (A: I, "Select D, count (E), where C = Vic Victrix und and G = true and A> = Date #" & TEXT (IF (WEEKDAY (J1, 1) = 3, J1, J1-WEEKDAY (J1 + 4)), "YYYY-MM-DD") & "and A <= date" & TEXT (J1 + 8-WEEKDAY (J1 + 5), "YYYY-" MM-DD ") &" to D order by number (E) descending, D designation D # name; #, number (E) # "#"

We've come to a point where people roll not just for their own character, but for their other specializations (something they do not use right now, but no one else needs it for their main character, so they roll for what's called " Off-Spec ") and this must also be tracked on the Loot Tracker.

Suppose I have this record:

 |  A         B              C      D
----------------------------------------------
1|  Name      Item           +1     Spec
----------------------------------------------
2|  Jim       Lorem          (✓)    MS
3|  Bob       Ipsum          (✓)    MS
4|  Jim       Dolor          (✓)    OS
5|  Liam      Sit            (✓)    MS
6|  Dave      Amet           (✓)    MS
7|  Luke      Consectetur    (✓)    OS

I somehow need a query or a single formula to work with the Loot Tracker:

Loot Tracker
-------------------
Name     MS+   OS+
-------------------
Jim      1     1
Bob      1     0
Liam     1     0
Dave     1     0
Luke     0     1

I hope that makes no sense, I have no idea how I would do it. I tried separate query formulas here in the third column, but they were not sorted correctly and matched the names. It must first be ordered by MS and then by OS.

Hash – password monitoring query

The IT security department is being reviewed, and the auditor has turned to our IT security team to ask them to show the results of the password verification process, comparing the existing database of hashed and user-defined passwords with the requirements of the password policy Do not provide results. Am I right. Can someone please explain

Query custom field with date

I have a custom field with a date picker. This date has the format 11/12/2019. In my request I have the following:

$meta_query = array(
        array(
                    'key'       => 'date-available',
                    'value'     => date("m/d/Y"),
                    'compare'   => '<',
                ),

    );

This works by displaying the posts where the custom date is less than the current date for that year and the December dates for that year are not displayed. But for some reason, the posts that have a date for 07/01/2020 will still be displayed. Does anyone have an idea why?

java – How is the order from being included in the query?

I have a query in Java and have to sort by name, but for the output of single quotes, etc., it's not clear if I'm doing it right.

 public ArrayList paisesEnUnContinente (int id) {
        ArrayList data = new ArrayList();
        try {
            Statement orden = conn.createStatement();
            ResultSet res;
            res = orden.executeQuery("SELECT * FROM pais WHERE IdContinente = " + id +"' order by Nombre");
            while (res.next()) {
                Pais p = new Pais();
                p.setIdCont(res.getInt("IdContinente"));
                p.setNombrePais(res.getString("Nombre"));
                p.setMillonesHab(res.getInt("Millones_habitantes"));
                data.add(p);
            }
            orden.close();
        } catch (SQLException e) {
            JOptionPane.showMessageDialog(null, e);
        }
        return data;
    }

Theme Development – WordPress INNER JOIN custom tables – SQL Query

H, I'm trying to get results from two tables using INNER JOIN in the WordPress theme template file, but I do not know what I'm doing wrong. Please help me, here is the code below

global $wpdb;
$user_id = get_current_user_id();
$sql= "SELECT client_id FROM quotes INNER JOIN client_info ON quotes.client_id = client_info.id WHERE user_id =".$user_id;
// user_id column has the data current user_id in it
 $results = $wpdb->get_results($sql);
  print_r($results); // results displays an empty array but both tables have data

wp query – how do I use a transient method?

It has been suggested to use a temporary method to remove the duplicate queries

Why does not this work? Is it the wrong way to use it?

 private function get_acf_list()
  {
      if(!class_exists('acf')){
        return array();
      }
      global $wpdb;
      if ( false === ( $pgggo_qry = get_transient( 'pgggo_acf_query_results' ) ) ) {
        // It wasn't there, so regenerate the data and save the transient
        $pgggo_qry = "SELECT post_excerpt as 'field_name', post_title as 'field_label' FROM {$wpdb->prefix}posts where post_type = 'acf-field'";
        set_transient( 'pgggo_acf_query_results', $pgggo_qry, 12 * 7200 );
      }

      $pgggo_list_results = $wpdb->get_results($pgggo_qry, ARRAY_A);
      $acf_field_array    = array();
      if (!empty($pgggo_list_results)) {
          foreach ($pgggo_list_results as $value) {
              $acf_field_array($value('field_name')) = $value('field_label');
          }
      }
      return $acf_field_array;
  }