Showing posts with label sql. Show all posts
Showing posts with label sql. Show all posts

Monday, August 15, 2011

Update Select Statement


UPDATE subject_section
SET facultyid =
(SELECT facultyid FROM ref_subject
WHERE subjectid = subject_section.subjectid) 

Thursday, June 16, 2011

SQL count the same value in selected field

Count number of user with same DOB in DB 
SELECT dob,
COUNT(dob) AS NumOccurrences
FROM members
GROUP BY dob
HAVING ( COUNT(dob) > 0 )