-
Select and Update database
Hi,
I have a mysql Database that has 2 tables:
Table1 - Batch:
batch_id
batch_code
batch_min
batch_max
batch_status
Table2 - jobs
jobs_id
jobs_batch_id
jobs_code
jobs_min
jobs_max
I need to write a sql statemente to update the database:
batch_max=SUM(jobs_min) and Batch_min=sum(jobs_max) where batch_id =jobs_batch_id.
Then I need to change de batch status:
batch_max batch_min batch_status
1 0 Passed
>=2 0 Failed
1 1 Failed
0 1 Passed
0 2 Failed
Can anyone please help me?
I have begain learn SQL last week and this seems to be complex ...
Thank You!
RESA
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
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
|
|
Bookmarks