Name: Deon Date: April 30, 2008 at 06:29:26 Pacific Subject: SQL Script OS: XP CPU/Ram: 2GHz /2GB Model/Manufacturer: Custom Build
Comment:
Hi all. If got a Database that with tables. SKU and Orderdetail. Fields of Table SKU >> SKU, Placement, SUSR1 SUSR2. Fields of Table Orderdetail >> SKU, Placement, Desc, Value
In Table SKU and Orderdetail the SKU fields are the link between the two. Table SKU has one line and in Orderdetail are the detail lines (Example 6) of that enry in the SKU table. That items link back to the SKU table and kan have SUSR2 values of either 800 or 300. I want my script to link the tables and give me the result of the entry of SKU that the detail lines have some entries that SUSR2 =800 and some =300. If all the lines SUSR2 =300 it must not diplay nor =800. It must have both. My script Displays all records. Select * from SKU, Orderdetail (SKU.SKU=Orderdetail.SKU and SKU.SUSR2=(‘800’,’300’)
Instead of combining the two numbers together, I would use an or statement. Be careful with this when you use multiple parameters. You may want to throw in a "having" statement or an "in" statement for the SKU number.