[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

SQL Statement

Posted on 2014-04-03
4
Medium Priority
?
297 Views
Last Modified: 2014-04-03
update SALESLINE set OrderStatus = 1
from SALESLINE  as a
inner join SALESTABLE as d
on a.SALESID = d.SALESID
where a.ORDERSTATUS = 9
and d.ORDSTATUS = 0;

For the statement above, a group of Sales transaction (with same SALESID) and include either OrderStatus =9 or 0, it's OrderStatus will be updated with OrderStatus = 1.

Am I correct ?

Tks
0
Comment
Question by:AXISHK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 668 total points
ID: 39974528
no. it will update to 1 if the status was 9, and a orderline status of 0 exists
0
 
LVL 53

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 668 total points
ID: 39974531
Hi

from which table is the order status a or d

and use Or insteat of And if you want either 0 or 9

Regards
0
 
LVL 70

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 664 total points
ID: 39975789
No.  It will update to 1 if the order status is 0 and any line with order line status = 9 exists.
0
 

Author Closing Comment

by:AXISHK
ID: 39977000
Tks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question