Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting rows from a table

Status
Not open for further replies.

gillyuk

Programmer
Nov 30, 2002
3
GB
HI i have these two tables shown below.
CREATE TABLE accounts
(
account INTEGER NOT NULL,
account_type ENUM('single','corporation')NOT NULL,
last_trans_date DATE NOT NULL,
minimum_balance DECIMAL(10,2) NOT NULL,
balance DECIMAL(10,2) NOT NULL,
PRIMARY KEY (account)
);

CREATE TABLE transactions
(
tran_account_number INTEGER NOT NULL,
trans_date DATE NOT NULL,
tran_amount DECIMAL(10,2) NOT NULL,
FOREIGN KEY (tran_account_number) REFERENCES accounts (account)
);

I have updated the date in my accounts table to todays and need to get all of the accounts in the table with todays dates Account number. I then need to use this account number to delete the relevant rows from the transaction table. Only problem is that my version of sql doesn't seem to support foreign keys. ANY ideas people. Thanks Andrew.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top