Computing.Net > Forums > Database > SQL Script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

SQL Script

Reply to Message Icon

Name: Deon
Date: April 30, 2008 at 06:29:26 Pacific
OS: XP
CPU/Ram: 2GHz /2GB
Product: 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’)

Please Help



Sponsored Link
Ads by Google

Response Number 1
Name: dotnet_ohio
Date: July 16, 2008 at 19:41:55 Pacific
Reply:

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.

http://www.dotnetohio.com


0
Reply to Message Icon

Related Posts

See More


program to start on power... file maker pro??????



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: SQL Script

how to send sql script's spool fie to mail. www.computing.net/answers/dbase/how-to-send-sql-scripts-spool-fie-to-mail/624.html

ODBC Interface for Perl or Python? www.computing.net/answers/dbase/odbc-interface-for-perl-or-python/211.html

need sql script www.computing.net/answers/dbase/need-sql-script/282.html