Tuesday, 15 February 2011

SQL Help (For Each) -


I am trying to write a SQL statement which needs a loop through the list of departments, like each for.

What do I still have

  Select Average (Pay), Assigned-> Name fROM edu_ucla_cs241_termproj_schema.InstructorImpl Where Assign-> Name = 'Anthropology'  

This will give me a table of average salary department 90.15 Anthropology

However, I want a loop through each department. Can I take this query through variables and loop through each department name?

you can not use

  SELECT avg (salary) , Assign-> Name FROM edu_ucla_cs241_termproj_schema.InstructorImpl Group Specified-> Name  

No comments:

Post a Comment