Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 8th, 2003, 12:30 AM
JiveTalkinRobot JiveTalkinRobot is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 33 JiveTalkinRobot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
SQL joins/update

Hi I am having a great deal of trouble with this join command and my professor's clarity is killing me.

table book_copy:
(CO, Book_ID, Category, DATE_DUE, Cust_IDN, NDATE_OUT, RDATE_OUT, Cust_IDR)

...where Cust_IDN is when a customer checks out a normal copy and Cust_IDR is when a customer checks out a reserve copy.

table check_out:
(Category, Max_Days)
this table shows the relationship of how long the customer can check out the book eg.

Category Max_Days
________ _________
faculty 70
employee 50
student 40
associate 20

table customer:
(Cust_ID, Category)

category as in faculty, employee, student, associate

What he wants is for us to make a join statement that updates
date_due according to the ndate_out and rdate_out (when it was checked out).

what I have so far is:

update copyBC
set date_due = (select ndate_out + max_days
from check_out_rule, customer
where copyBC.CIDN = customer.CID and check_out_rule.category = customer.category);

but it is not working... any help would be great thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > SQL joins/update


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT