Does the order of the clustered index have the same restrictions as the non-clustered index in the search?

I have a table full of lots of data, and I want to use the following clustered index:

(account_id, group_id, run_id, page_id, date)

For a nonclustered index, if I had to use WHERE filters that involve account_id, page_idY date_timeI know the index won't work because I also don't include group_id Y run_id. Does the same apply when using a clustered index? I often want to make a query in the form:

SELECT * 
FROM my_table
WHERE ad_account_id = %d
  AND page_id = %d
  AND date >= DATE(%s)
  AND date <= DATE(%s)

But sometimes I have queries like:

SELECT * 
FROM my_table
WHERE ad_account_id = %d
  AND group_id = %d
  AND date >= DATE(%s)
  AND date <= DATE(%s)

or

SELECT * 
FROM my_table
WHERE ad_account_id = %d
  AND group_id = %d
  AND run_id = %d
  AND date >= DATE(%s)
  AND date <= DATE(%s)

It is not obvious if any of these take advantage of the clustered index beyond that given in the account_id (I'm pretty sure this isn't doing a full scan of the table, but even there I'm not sure.)

Reference request – Orthonormally based higher order domestic products

Leave $ pi $ be a measure of probability in some space $ mathcal {X} $, and let $ Phi = { phi_k } _ {k geqslant 0} $ be an orthonormal (possibly complex value) basis for $ L ^ 2 ( pi) $, with $ phi_0 equiv 1 $. Leave $ f in L ^ 2 ( pi) $ be expressible on this basis as $ f = sum_ {k geqslant 0} f_k phi_k $.

In some calculations, it has become relevant for me to handle (and bind) form quantities

begin {align}
Q ^ k = int pi (dx) | f (x) | ^ 2 | phi_k (x) | ^ 2 quad text {for} k geqslant 1,
end {align}

and ideally I would like a limit of how $ Q ^ k leqslant c ^ k sum_ {k geqslant 0} | f_k | ^ 2 $ for some explicit sequence $ {c ^ k } _ {k geqslant 0} $.

At first, $ Q ^ k $ is a quadratic form in the $ {f_k } _ {k geqslant 0} $, and this should be useful. However, the nature of this quadratic form is generally somewhat mysterious; should end up involving quantities like

begin {align}
Q ^ k_ {ij} & = int pi (dx) phi_i (x) overline { phi} _j (x) | phi_k (x) | ^ 2 \
& = int pi (dx) left ( phi_i (x) overline { phi} _k (x) right) cdot overline { left ( phi_j (x) overline { phi} _k (x) right)} quad text {for} i, j geqslant 0
end {align}

and this should depend a lot on the properties of the base $ Phi $.

Ultimately, I think a solution to this problem will only be possible once a base is fixed, and it is arranged to be quite manageable. In the case where $ Phi $ it's a Fourier base, for example, things are pretty good, and one can take $ c ^ k equiv 1 $. I think it might also be possible in other cases where $ phi_a overline { phi_b} $ can be written as linear combinations of other $ phi_c $; beyond that it could be quite complicated.

My question is: there is other Orthonormal bases for what limits in this way should be manageable? I would be particularly happy if there were classic orthogonal polynomial families for which this is possible, but I'm not sure where to look for such results. Any relevant reference will also be welcomed.

tracking number in woocommerce order

I tried inserting the tracking_ID as described in the tracking number field in the Woocommerce order in my order and adding the code in the customer-complete-order.php file, but I will not always receive tracking_id in the email.

Hope someone can help me.
kindly regards

Retrieve by inserting the ORDER of the merged table in SQL Server

I have 3 tables like "BASE_Customer", "BASE_Invoice" and "BASE_Payment", the structure below,

enter the image description here

Query:

CREATE TABLE BASE_Customer
(
    CustomerId INT IDENTITY(1,1),
    CustomerName VARCHAR(45)
    PRIMARY KEY(CustomerId)
)
INSERT INTO BASE_Customer (CustomerName) VAlUES ('LEE')

CREATE TABLE BASE_Invoice
(
    InvoiceId INT IDENTITY(1,1),
    InvoiceDate DATE,
    CustomerId INT NOT NULL,
    InvoiceMethod VARCHAR(45) NOT NULL, -- CASH or CREDIT
    Amount MONEY,
    PRIMARY KEY(InvoiceId)
)
INSERT INTO BASE_Invoice (InvoiceDate, CustomerId, InvoiceMethod, Amount) VAlUES ('2020-01-16', 1, 'CASH', 1000);
INSERT INTO BASE_Invoice (InvoiceDate, CustomerId, InvoiceMethod, Amount) VAlUES ('2020-01-16', 1, 'CREDIT', 2000);
INSERT INTO BASE_Invoice (InvoiceDate, CustomerId, InvoiceMethod, Amount) VAlUES ('2020-01-17', 1, 'CREDIT', 500);
INSERT INTO BASE_Invoice (InvoiceDate, CustomerId, InvoiceMethod, Amount) VAlUES ('2020-01-18', 1, 'CREDIT', 2000);
INSERT INTO BASE_Invoice (InvoiceDate, CustomerId, InvoiceMethod, Amount) VAlUES ('2020-01-18', 1, 'CASH', 150);
INSERT INTO BASE_Invoice (InvoiceDate, CustomerId, InvoiceMethod, Amount) VAlUES ('2020-01-19', 1, 'CREDIT', 1000);
INSERT INTO BASE_Invoice (InvoiceDate, CustomerId, InvoiceMethod, Amount) VAlUES ('2020-01-19', 1, 'CREDIT', 3000);
INSERT INTO BASE_Invoice (InvoiceDate, CustomerId, InvoiceMethod, Amount) VAlUES ('2020-01-19', 1, 'CASH', 1000);
INSERT INTO BASE_Invoice (InvoiceDate, CustomerId, InvoiceMethod, Amount) VAlUES ('2020-01-20', 1, 'CREDIT', 2250);

CREATE TABLE BASE_Payment
(
    PaymentId INT IDENTITY(1,1),
    PaymentDate DATE,
    CustomerId INT NOT NULL,
    InvoiceId INT NULL,
    PaymentMethod VARCHAR(45) NOT NULL, -- CASH or CREDIT, ADVANCE
    Amount MONEY,
    PRIMARY KEY(PaymentId)
)
INSERT INTO BASE_Payment (PaymentDate, CustomerId, InvoiceId, PaymentMethod, Amount) VAlUES ('2020-01-16', 1, 1, 'CASH', 1000);
INSERT INTO BASE_Payment (PaymentDate, CustomerId, PaymentMethod, Amount) VAlUES ('2020-01-16', 1, 'CREDIT', 500);
INSERT INTO BASE_Payment (PaymentDate, CustomerId, InvoiceId, PaymentMethod, Amount) VAlUES ('2020-01-18', 1, 4, 'ADVANCE', 500);
INSERT INTO BASE_Payment (PaymentDate, CustomerId, PaymentMethod, Amount) VAlUES ('2020-01-18', 1, 'CREDIT', 2000);
INSERT INTO BASE_Payment (PaymentDate, CustomerId, InvoiceId, PaymentMethod, Amount) VAlUES ('2020-01-18', 1, 5, 'CASH', 150);
INSERT INTO BASE_Payment (PaymentDate, CustomerId, PaymentMethod, Amount) VAlUES ('2020-01-18', 1, 'CREDIT', 5000);
INSERT INTO BASE_Payment (PaymentDate, CustomerId, PaymentMethod, Amount) VAlUES ('2020-01-19', 1, 'CREDIT', 1200);
INSERT INTO BASE_Payment (PaymentDate, CustomerId, InvoiceId, PaymentMethod, Amount) VAlUES ('2020-01-19', 1, 7, 'ADVANCE', 500)
INSERT INTO BASE_Payment (PaymentDate, CustomerId, InvoiceId, PaymentMethod, Amount) VAlUES ('2020-01-19', 1, 8, 'CASH', 1000);
INSERT INTO BASE_Payment (PaymentDate, CustomerId, InvoiceId, PaymentMethod, Amount) VAlUES ('2020-01-20', 1, 9, 'ADVANCE', 750);
  • The customer table must join both "BASE_Invoice" and "BASE_Payment" tables (CustomerId is a foreign key in both tables)
  • when inserting a data in the table "BASE_Invoice" if the column of the invoice method is CASH at the moment the invoice payment is inserted with the CASH payment method,

  • when inserting data in the table "BASE_Invoice" if the column of the invoice method CREDIT sometimes we insert the payment with the ADVANCE payment method or else we do not insert the payment in the payment table.

  • in the payment table you can only insert CREDIT payment methods

I need to merge all tables once and retrieve the output ORDER, like the screenshot below,

enter the image description here

The problem is how to merge tables and get the transaction order

magento2: Magento 2 free downloadable product order status closes automatically

I have free downloadable products in my Magento 2 store (Magento 2.3.4, Migrated from Magneto 1). If a customer purchases this free downloadable product, they receive a zero subtotal order that I set up to process status through Magento payment settings automatically. The order is also automatically billed, but the order always has the status "closed" automatically with a properly censored invoice, so the download does not work. A credit note has not been created! This should be the only way to get to the closed state according to the Magento state schema.

This behavior was not observed in Magento 1, it always ended with "completed" status and downloading was automatically enabled.

Any ideas?

Tax applied to EBAY order

I am using EBAY in Magento. I want to add taxes on EBay. Currently the tax is 0 on the EBAY order. How can I add taxes on Ebay orders?

Hooks – Run a custom function after purchasing a course / completing an order on LearnPress?

I need to execute a function immediately when someone buys a course or an order completes successfully. The function I'm trying to execute is actually called an API. I don't see a proper LearnPress hook.

It works perfectly when I use "user_register"(when someone registers this fire hook) hook but it doesn't work when i use this "learn_press_confirm_order" hook given by LearnPress.

Do you know that there is some appropriate way I can go about and accomplish this?
Thanks for your time

The governor of Florida has just issued a stay-at-home order, does that mean we can still leave our homes since it is not an order in his recommendation?

Yes … for now … but the more people flaunt the "recommendation," the more likely it is to be followed more strictly, from nightly curfews to direct orders to stay off the streets unless you are on call. medical, law enforcement or government …

Just yesterday I was reading about the situation in Australia, and how the government can order a full shutdown, ordering all businesses to close, and ordering all citizens to remain in their homes.

An important reason why this step may be necessary is because each previous order has generally been followed for the first few days, but then was largely ignored after that. This is said to be the reason why the numbers have dropped and then increased again every few weeks.

How to sort a Python dictionary in descending order? Error: ValueError: Is the truth value of an array with more than one element ambiguous?

I am trying to sort a dictionary that is returned in a code snippet that I am implementing, the dictionary is returned EXACTLY like this when I print:

print(dict) 


{'1': array((44, 32, 56, 57, 43, 21, 36, 35, 39, 27, 23, 24, 25, 26, 31, 28, 29,
                   30, 20, 22, 18, 19,  8,  1, 33,  2,  3,  4,  0,  6,  7,  9, 17, 10,
                   11, 12, 50, 55, 13, 14, 15, 16, 52, 46, 45, 34, 42, 37, 40,  5, 54,
                   51, 53, 48, 38, 41, 49, 47), dtype=int64), '2': array((50, 27, 39, 44, 47, 35, 28, 25, 37, 36, 29, 20, 21, 22, 13,  9, 18,
                    6,  2, 14, 15, 16,  4,  7, 24, 19,  1,  5,  8, 17, 12, 11,  0,  3,
                   10, 53, 49, 42, 55, 57, 45, 56, 54, 38, 23, 26, 31, 52, 51, 43, 33,
                   46, 48, 40, 30, 34, 32, 41), dtype=int64), '3': array((54, 29, 40, 42, 53, 23, 31, 34, 37, 39, 38, 17, 19, 22, 12, 10, 11,
                    3,  6, 13, 15,  8, 14, 16, 25, 27,  4,  5, 21,  0,  1, 18,  9,  7,
                    2, 32, 28, 46, 48, 57, 56, 55, 20, 44, 33, 26, 41, 52, 24, 45, 43,
                   50, 51, 49, 35, 30, 47, 36), dtype=int64), '4': array((57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41,
                   40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24,
                   23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10,  9,  8,  7,
                    6,  5,  4,  3,  2,  1,  0), dtype=int64)}

I tried to sort this dictionary this way:

dict={k: v for k, v in sorted(dict.items(), key=lambda item: item(1), reverse=True)}

Which returns the following error:

ValueError: The truth value of an array with more than one element is
ambiguous

What I understand: This is a dictionary containing an array of int64 arrays. Each int64 in the arrays inside dictate corresponds to a value of another variable that I NEED to pass to dictate. I need to order this dictate in descending order and I have tried various ways that went wrong.

Does anyone know how to resolve this error?