-
SQL 2005 If Statement some help please
I'm new to SQL 2005 and would greatly appreciate some help in the following problem.
I have two tables joint by the ID field
In table one I have the following fields Sequence, Quan and ID.
In table two I have Quan and ID
Here is what I would like if possible.
If Sequence is = Null then show me the Quan value from table 2 else show me the Quan value from table 1.
Last edited by chapo; 02-27-2008 at 08:04 PM.
-
SELECT
CASE WHEN Table1.Sequence IS NULL THEN Table2.Quan
ELSE Table1.Quan END
FROM Table1 JOIN Table2
ON Table1.ID = Table2.ID
-
Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|