An oscillating sprinkler includes a hollow tube having a groove defined axially therein so as to receive a nozzle unit therein. The nozzle unit has flexible nozzles which extend through holes in the inner bottom of the groove. The hollow tube has first paths and second paths defined radially in the outside thereof. The distance between any two adjacent first paths is smaller than the distance between any two of the adjacent second paths. A resilient wire is formed with continuous S-shaped portions, and each S-shaped portion has two adjustment slots opening toward opposite directions. The nozzles are movable in the adjustment slots. The hollow tube is received between a top member and a bottom member. The resilient wire is moved with the movement of the top member. The nozzles are pulled and pushed by the S-shaped portions to have different patterns of sprinkling.