и accountpool.name =? which links to a list to select the balance pool and the table below runs on this selection (one selection) Balance Pool one selection
is there a way the sql can run on multiple balance pools i've selected
Balance Pool multiple selection
this list of for the balance pool is
Balance Pool
NL - A
DE - A
IT - A
Es - A
UK - A
FR - A
nl - b
uk - 4 < /p>
Код: Выделить всё
SELECT
accountpool.name as Balance_Pool,
account.name as Account,
item.cpcs as We_Or_They,
item.repserialnum as Store_Number,
item.availorpaid as Transaction_Date,
class.name as Tender_Type,
fieldvals.name as Credit_Debit,
item.currency,
Signed_Amount = SUM(CASE
WHEN fieldvals.name = 'Credit' THEN item.amount
WHEN fieldvals.name = 'Debit' THEN (item.amount*-1)
END),
SUM(item.signedamount1) as Charge_Amount,
SUM(item.signedamount2) as Gross_or_Net_Amount,
SUM(item.useramount1) as UserAmount1,
item.addr1 as Settlement_Account,
item.serialnumber as Item_Type,
item.city as Event_Type,
item.name1 as Transaction_Description,
Full_Statement_Description = CASE
WHEN item.cpcs = "They - Amex" AND item.serialnumber = "Balance" THEN item.usertext5 END,
Match_Status = CASE
WHEN item.matchid = -1 THEN "Unmatched" ELSE "Matched" END,
item.firstdate,
inouthistory.name as Import_ID,
item.importid as ImportIDNumber,
item.usertext3 as IssueLog,
company.name as Company
FROM item item
LEFT JOIN fieldvals on item.dcip=fieldvals.valuex AND fieldvals.id='40'
LEFT JOIN Class on item.class = class.id
LEFT JOIN account on item.accountid = account.id AND item.companyid = account.companyid
LEFT JOIN accountpool on account.poolid = accountpool.id
LEFT JOIN Company on item.companyid = company.id
LEFT JOIN inouthistory on item.importid = inouthistory.id
WHERE item.itemstate '4115'
AND account.name 'DONOTIMPORT'
AND (Item.CPCS 'We')
AND (Item.CPCS 'They - Bank')
AND Item.AvailOrPaid
Подробнее здесь: [url]https://stackoverflow.com/questions/79548756/please-how-can-i-update-my-sql-to-pass-a-selection-of-multiple-values-from-a-lis[/url]
Мобильная версия