Q:

Combine two queries and display result in one table?

Hi guys i got stuck at one very simple issue that the following two queries are working fine but i want the result of both the queries in one table ,so what would be the possible way of joining these two so that they will combine and give result in one table,i tried UNION but it didnt work.Kindly tell me the solution.Thanks!
Select ITEM_DETAILS.ITEM_MODEL,
       ITEM_DETAILS.ITEM_NAME,
       ITEM_DETAILS.ITEM_DESCRIPTION,
       ITEM_DETAILS.VENDOR_NAME,
       ITEM_DETAILS.INVOICE_NUM,
       ITEMS_MASTER.QUANTITY 
       from ITEM_DETAILS
       inner join ITEMS_MASTER 
       on ITEM_DETAILS.ITEM_MODEL=ITEMS_MASTER.ITEM_MODEL

Select RATE=(CASE WHEN Discount IS NULL OR Discount=0 THEN RATE ELSE RATE-(RATE*(Discount/100))END),              
       AMOUNT=(CASE WHEN Discount IS NULL OR Discount=0 THEN AMOUNT ELSE AMOUNT-(AMOUNT*(Discount/100)) END)
       from ITEM_DETAILS    

A:

if it is sql server did you try something like this 
Select ITEM_DETAILS.ITEM_MODEL,
       ITEM_DETAILS.ITEM_NAME,
       ITEM_DETAILS.ITEM_DESCRIPTION,
       ITEM_DETAILS.VENDOR_NAME,
       ITEM_DETAILS.INVOICE_NUM,
       ITEMS_MASTER.QUANTITY,
       CASE WHEN ITEM_DETAILS.Discount IS NULL OR ITEM_DETAILS.Discount=0 THEN ITEM_DETAILS.RATE ELSE ITEM_DETAILS.RATE-(ITEM_DETAILS.RATE*(ITEM_DETAILS.Discount/100))END AS 'RATE',
       CASE WHEN ITEM_DETAILS.Discount IS NULL OR ITEM_DETAILS.Discount=0 THEN ITEM_DETAILS.AMOUNT ELSE ITEM_DETAILS.AMOUNT-(ITEM_DETAILS.AMOUNT*(ITEM_DETAILS.Discount/100)) END AS 'AMOUNT'
       from ITEM_DETAILS
       inner join ITEMS_MASTER 
       on ITEM_DETAILS.ITEM_MODEL=ITEMS_MASTER.ITEM_MODEL

I am not sure if you want all the rates and amount from the ITEM_DETAILS table or only those which satisfy the join condition

