Reputation: 223
I have a little problem in updating date. My first table is
DONOR
donor-nic----username-----status
111----------ali----------available
222---------usman--------notavailable
My second table is
DONATION
donation_id------donor_nic-----date---
1----------------111----------2012/03/04
2---------------111-----------2012/06/07
3----------------111---------2012/07/08
4----------------222---------2012/03/03
Now I am editing profile like:
I want to do the following:
I don't know how to select all the dates of donor (111) and then match this date from the new date.
Upvotes: 0
Views: 200
Reputation: 84
To see if there is already a specified date corresponding to a specific donor_nic, use
SELECT COUNT(date) > 0 FROM DONATION WHERE donor_nic="111" AND date="your date";
This should return true
if "your date" is already specified for that donor_nic.
Upvotes: 1