-
normalization
I have created a table to store the employees educational details.The columns are empid,eduid(Foreign key).
primary key is both empid and eduid(to avoid entering the same data muliple times).A person may have four or five degrees at times. Can anybody suggest a query to search for persons whose educational is more than one degree(like person with M.B.A and B.E and M.A in public Administration ).All the degrees have eduid and can be received from education(eduid(Primary key),education) table.
-
normalization (reply)
try to use this:
declare ccc cursor for select count(empid) as Amount, empid from education group by empid
declare
@amount int,
@empid int
open ccc
fetch next from ccc into @amount, @empid
while @@fetch_status = 0
begin
if @amount > 1
begin
select distinct e.empname, g.gradename from employee e, education g where e.empid=@empid
end
fetch next from ccc into @amount, @empid
end
close ccc
deallocate ccc
in this example gradename is a field in table education with education's description. (MBA, BE, etc.)
------------
aniruth at 12/6/2001 5:38:17 AM
I have created a table to store the employees educational details.The columns are empid,eduid(Foreign key).
primary key is both empid and eduid(to avoid entering the same data muliple times).A person may have four or five degrees at times. Can anybody suggest a query to search for persons whose educational is more than one degree(like person with M.B.A and B.E and M.A in public Administration ).All the degrees have eduid and can be received from education(eduid(Primary key),education) table.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|