The first known use of pipes was in Ancient Egypt. The Pyramid of Sahure, completed around the 25th century BC, included a temple with an elaborate drainage system including more than  of copper piping.
When steel pipes were introduced in 19th century, they initially were riveted, and later clamped with H-shaped bars, until by the early 1930s these methods were replaced by welding, which is still widely used today.