Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by omid020

  1. omid020

    problem with join

    Sorry , I think there is a misunderstanding ! Excuse me if I made you upset , I have a mysql manual but it`s not easy to find and fluence for me , I`ve learned many basic conceptions from SQL lessons in www.w3schools.com and mysql manual but sometimes when my problems get complicated I try to...
  2. omid020

    problem with join

    No , I don`t use mysql manual , I`ve just tried to find something from simple googling [wink] Thanks for your peerless support , although my database will grow more but I hope to solve other future problems myself [hourglass]
  3. omid020

    problem with join

    Sorry for my mistake [censored] Can I use UNION ALL for more than 2 SELECT queries ? Is UNION for joining two SELECT statements only !?
  4. omid020

    I can`t retrive all required data from both tables

    Thanks gmmastros , my problem is solved here : http://www.tek-tips.com/viewthread.cfm?qid=1584918
  5. omid020

    problem with join

    Wonderful result :-> This is code : SELECT leafCode , colorsCode , COALESCE(SUM(`INPUT`), 0) AS `INPUT` , COALESCE(SUM(`OUTPUT`), 0) AS `OUTPUT` , COALESCE(SUM(`INPUT`), 0) - COALESCE(SUM(`OUTPUT`), 0) AS `INVENTORY` FROM ( SELECT rs_leaves.leafCode ...
  6. omid020

    problem with join

    Ok , I wrote this : SELECT rs_leaves.leafCode, rs_colors.colorsCode, SUM(Distinct assign_details.assAmount) AS OUTPUT FROM assign_details INNER JOIN rs_leaves ON assign_details.leafName = rs_leaves.leafID INNER JOIN rs_colors ON assign_details.leafColor = rs_colors.colorsID GROUP BY...
  7. omid020

    problem with join

    Hi Rudy , What should I do for second step ?
  8. omid020

    problem with join

    Mmmm , I like but now I`m going to bed , can I do it tomorrow ? If you have any trouble with next time , I`ll keep it on tonight . What`s your idea ?
  9. omid020

    problem with join

    No , it`s not possible . Every value in receipt_details.leafName exits in rs_leaves.leafID . receipt_details table content confirm it : +-----------+-------+----------+----------+-----------+-----------+------------+ | detailsID | recID | leafName | leafCode | leafColor | recAmount | recComment...
  10. omid020

    problem with join

    Thanks :) This is first step : SELECT rs_leaves.leafCode, rs_colors.colorsCode, SUM(Distinct receipt_details.recAmount) AS INPUT FROM receipt_details LEFT JOIN rs_leaves ON receipt_details.leafName = rs_leaves.leafID LEFT JOIN rs_colors ON receipt_details.leafColor = rs_colors.colorsID...
  11. omid020

    problem with join

    Maybe I`m wrong , but from last post I found that I could write this query : SELECT rs_leaves.leafCode, rs_colors.colorsCode, SUM(Distinct receipt_details.recAmount) AS INPUT, SUM(Distinct assign_details.assAmount) AS OUTPUT, SUM(Distinct receipt_details.recAmount) - SUM(Distinct...
  12. omid020

    problem with join

    Thanks Rudy for your reply , let`s assume there is a (warehouse), surely every warehouse has some inputs and outputs . To calculate warehouse inventory we use this formula : (inputs - outputs) In my database inputs are in receipt_details table and outputs are in assign_details table ; our...
  13. omid020

    problem with join

    Hi, 4 required tables content is described below : 1- rs_leaves +--------+----------+-----------------------------------------+ | leafID | leafCode | leafName | +--------+----------+-----------------------------------------+ | 1 | A | WOOD 1...
  14. omid020

    I can`t retrive all required data from both tables

    4 tables content is described below : 1- rs_leaves +--------+----------+-----------------------------------------+ | leafID | leafCode | leafName | +--------+----------+-----------------------------------------+ | 1 | A | WOOD 1 | | 2 | B...
  15. omid020

    I can`t retrive all required data from both tables

    Sry , I forgot to write this query : COALESCE(Sum(Distinct receipt_details.recAmount), 0) - COALESCE(Sum(Distinct assign_details.assAmount), 0) As 'FWarehouse'

Part and Inventory Search

Back
Top