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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: omid020
  • Order by date
  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'
  16. omid020

    I can`t retrive all required data from both tables

    Because I want to migrate this SQL code to MySQL , I can`t use (Full Join) . This is an example to describe more about this DB content and related problem : rs_leaves table has data such : leafID---> 1 leafCode---> A leafName---> Wood rs_colors table has data such : colorsID---> 1...
  17. omid020

    I can`t retrive all required data from both tables

    Hello , There is 4 tables in my DB : assign_details receipt_details rs_leaves rs_colors I should get all available data from "assign_details" and "receipt_details" tables , but now my query shows only common available data . For example when "assign_details" has an element that there is not in...
  18. omid020

    Could I embed HTML tags into SQL ?

    Hi , Can I mix my SQL code with some HTML tags ? Let`s assume that this is main code : Select projects.projectName, projects.pictureName Could I have something like this one instead of that : Select projects.projectName, <img src="./pics/projects.pictureName" />...
  19. omid020

    have problem with some query issues

    Thanks rudy , you are really a good teacher for teaching SQL power ; I used your hints and solved my many problems but still I`m confused with something else ! this is my final code : Select t.projectName, t.LeafCode, t.ColorsCode, t.FirstWarehouse, t.SecondWarehouse, t.Sent, t.OrderAmount...
  20. omid020

    have problem with some query issues

    Thanks r937 , now I found when should I use Case statement . But could you please tell me how could I obtain this formula result with SQL : (projects_details.OrderAmount) - (FirstWarehouse) + (FactoryInventory) = Remained Should I unwrap (FirstWarehouse) and (FactoryInventory) to their original...

Part and Inventory Search

Back
Top