Suljettu

DataBase Query to verify quantitys

hello , i am looking to fix a query to verify some stock accounts those 4 to 5 tables some sums to check if the stock is right

must compare the current stock vrs the sum of initial+adjuments stock and if is wrong update with the right value.

SELECT [url removed, login to view],[url removed, login to view] as cantidadInv,sum([url removed, login to view]) as compraSt , sum([url removed, login to view]) as vendido,

SUM(IF([url removed, login to view] = 'addition', [url removed, login to view], 0))-SUM(IF([url removed, login to view] = 'subtraction', [url removed, login to view], 0))+sum([url removed, login to view]) as ajustes

FROM `sma_purchase_items` compra

inner join sma_products productos on [url removed, login to view] = compra.product_id

left join sma_sale_items vendidos on [url removed, login to view] = vendidos.product_id

left join sma_adjustment_items ajustes on vendidos.product_id = ajustes.product_id

group by [url removed, login to view]

this is mostly the query must be fixed due in some rows shows another information. if need i can share the db and explain via teamviewer or similar

Taidot: Tietokannan hallinto, Tietokantakehitys, Tietokantaohjelmointi, MySQL

Näytä lisää: script query database size, input output query database, wordpress query database, php drop list query database, oscommerce database tables products, script php query database, need products sale, php query database drop, user forms query database, online products sale, oscommerce database missing products, execution query database failed modx, arcgis serve query database, database amazon products, query database web form

About the Employer:
( 0 reviews ) United States

Projektin tunnus: #13121483

10 freelanceria on tarjonnut keskimäärin 34 $ tähän työhön

30 $ USD 1 päivässä
(7 arvostelua)
4.7
111 $ USD 1 päivässä
(4 arvostelua)
4.1
testotorko

Hi, I read carefully your project, and I wanna do it for you. If you wanna work together, send me a message to discuss details. I am an experienced Web Developer and Web Designer, and have worked with wide variety of s Lisää

25 $ USD 1 päivässä
(6 arvostelua)
3.6
amjadali4888

Greetings I have read your job description and I want to talk about more that regards that I can do that project within the time frame I have more than 3 years’ experience in web development skills like PHP WordPre Lisää

25 $ USD 1 päivässä
(6 arvostelua)
3.1
shahgsahab1

Website Design and Development Developer Who Creates Innovation For You! ONLY FOR YOU We have years of development and implementation experience on projects ranging from small departmental applications through comp Lisää

25 $ USD 1 päivässä
(2 arvostelua)
1.4
olarid

Hi, I read through your request. I can fix the query. I have up to six years of experience working with various databases (Mysql, ms sql, oracle) using Structure Query Language (SQL) to perform tasks raging from simp Lisää

25 $ USD 1 päivässä
(0 arvostelua)
0.0
graphichaks24

A proposal has not yet been provided

25 $ USD 1 päivässä
(0 arvostelua)
0.0
aap31374

I have 10+ years database development experience in sql server, Mysql and Postgres. I have also worked in SSIS and SSRS. I assure that i will give you fully satisfaction about this assignment.

25 $ USD 1 päivässä
(0 arvostelua)
0.0
veslar

I think the problem lies in this join LEFT JOIN sma_sale_items vendidos ON [url removed, login to view] = vendidos.product_id should be changed to LEFT JOIN sma_sale_items vendidos ON compra.product_id = [url removed, login to view] Lisää

15 $ USD 1 päivässä
(0 arvostelua)
0.0
30 $ USD 1 päivässä
(0 arvostelua)
0.0
arindamkumar

A proposal has not yet been provided

30 $ USD 1 päivässä
(0 arvostelua)
0.0
25 $ USD 1 päivässä
(0 arvostelua)
0.0