bcp5190
asked on
How can i write this Query ?
If i have tables as follows
Orders:
OrderID, CustomerID, RECEIVED_Time, SHIIPPED_Time
Details
OrderID, ProductID, Quentity
Parts:
PNO, PRICE
How can i write a quesry to get the orderID and waiting time (Shipped - Received) for All orders which are greated than $50.
And how can i write the PL/SQL for same query.
Orders:
OrderID, CustomerID, RECEIVED_Time, SHIIPPED_Time
Details
OrderID, ProductID, Quentity
Parts:
PNO, PRICE
How can i write a quesry to get the orderID and waiting time (Shipped - Received) for All orders which are greated than $50.
And how can i write the PL/SQL for same query.
ASKER
How can i write same query in pl/sql that returns Status = success or Fail. And returns ErrMag = "Error message" if error occurs or record not found.
ASKER
Winning, Can you please modify your query so it compaire with total price per order.
Query should compaire with Total Order Price = (p.Qty * p.Price)
Query should compaire with Total Order Price = (p.Qty * p.Price)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
bcp5190,
Some of these questions have been open for some time, and our records show you logged in as recently as Jan 23, 2002. Please resolve them appropriately as soon as possible.
https://www.experts-exchange.com/jsp/qShow.jsp?ta=osgen&qid=20250789
https://www.experts-exchange.com/jsp/qShow.jsp?ta=win2k&qid=20224108
https://www.experts-exchange.com/jsp/qShow.jsp?ta=win2k&qid=20224027
https://www.experts-exchange.com/jsp/qShow.jsp?ta=win2k&qid=20218730
https://www.experts-exchange.com/jsp/qShow.jsp?ta=msoffice&qid=20249772
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20255121
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20250781
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20248828
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20247239
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20244374
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=20189160
https://www.experts-exchange.com/jsp/qShow.jsp?ta=javascript&qid=20241876
https://www.experts-exchange.com/jsp/qShow.jsp?ta=javascript&qid=20187022
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20249686
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20248047
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20246855
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20246318
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20244409
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20242375
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20093765
https://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20249476
https://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20158800
https://www.experts-exchange.com/jsp/qShow.jsp?ta=html&qid=20235587
https://www.experts-exchange.com/jsp/qShow.jsp?ta=iis&qid=20186130
Thanks,
Netminder
Community Support Moderator
Experts Exchange
Some of these questions have been open for some time, and our records show you logged in as recently as Jan 23, 2002. Please resolve them appropriately as soon as possible.
https://www.experts-exchange.com/jsp/qShow.jsp?ta=osgen&qid=20250789
https://www.experts-exchange.com/jsp/qShow.jsp?ta=win2k&qid=20224108
https://www.experts-exchange.com/jsp/qShow.jsp?ta=win2k&qid=20224027
https://www.experts-exchange.com/jsp/qShow.jsp?ta=win2k&qid=20218730
https://www.experts-exchange.com/jsp/qShow.jsp?ta=msoffice&qid=20249772
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20255121
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20250781
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20248828
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20247239
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20244374
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=20189160
https://www.experts-exchange.com/jsp/qShow.jsp?ta=javascript&qid=20241876
https://www.experts-exchange.com/jsp/qShow.jsp?ta=javascript&qid=20187022
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20249686
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20248047
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20246855
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20246318
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20244409
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20242375
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20093765
https://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20249476
https://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20158800
https://www.experts-exchange.com/jsp/qShow.jsp?ta=html&qid=20235587
https://www.experts-exchange.com/jsp/qShow.jsp?ta=iis&qid=20186130
Thanks,
Netminder
Community Support Moderator
Experts Exchange
select o.orderID, o.SHIPPED_Time-o.RECEIVED_
from Orders o, Details d, Parts p
where o.orderID=d.orderID
and d.ProductID=p.PNO
and p.PRICE>=50
winningl