skip to Main Content

Postgresql – How to optimize complex sorting?

I'm building a language learning platform, here are some tables: create table users ( id bigserial primary key, ... ) create table users_languages ( id bigserial primary key, user_id bigint not null constraint users_languages_user_id_foreign references users, level varchar(255) not null,…

VIEW QUESTION

MySQL UPDATE with JOIN failing

update loan l inner join ( select LoanId, sum(Amount) as Amount from loanpayment where LoanId = pLoanId ) as lp on l.Id = lp.LoanId set l.CurBalance = OriginalAmount + TermMonths *(OriginalAmount * MonthlyRate/100) - coalesce(lp.Amount,0) where l.Id = pLoanId ;…

VIEW QUESTION

SQL query for woocommerce

I built a woocommerce sql query to list all products with their important values. Here my query: SELECT p.ID, p.post_type as Art, p.post_title AS Produkt, p.post_excerpt AS Beschreibung, t.name AS Produzent, MAX(CASE WHEN pm1.meta_key = 'faktor' then pm1.meta_value ELSE NULL…

VIEW QUESTION
Back To Top
Search