How do I use an aggregate function, e.g. count or max of dvds where I have 4 tables & the table I want to get a count or max from (rental) has a composite key that is a combo of dvd and copy
How do I use an aggregate function, e.g. count or max of dvds where I have 4 tables & the table I want to get a count or max from (rental) has a composite key that is a combo of dvd and copy. I want to know the number of dvds sold out/not...
User Profile
Collapse
-
mmclancy started a topic Aggregate function, count or max, on >2 joined tables where pk is compositein OracleAggregate function, count or max, on >2 joined tables where pk is composite
Last edited by zmbd; Dec 4 '12, 03:13 PM. Reason: [Z{Please use the <CODE/> button to format posted programs, HTML, and SQL}{Stepped the posted SQL}] -
Thank you, Rabbit. I'm new to sql, it's true I had seen TO_CHAR when I looked at the documentation but always preceded by SELECT instead of INSERT. I only now figured out how to make it all work!! I really appreciate you pointing me in the right direction. -
Inserting date (mmyy) into table
I'm using Oracle's SQL Developer to do the following:
...Code:CREATE TABLE Account ( AccountID INT NOT NULL, CreditID INT NOT NULL, CardType VARCHAR(15) NOT NULL, ExpiryDate DATE, PRIMARY KEY (AccountID), CONSTRAINT fk_credit_account FOREIGN KEY (CreditID) REFERENCES CreditCard ) -- Table created -- ExpiryDate not returning as mm/yy INSERT INTO Account (AccountID,CreditID,CardType,ExpiryDate);
No activity results to display
Show More
Leave a comment: