SQL to Generate Random IP Address
Generate a fake IP address - helpful generating test data.
SELECT CONCAT(
TRUNC(RANDOM() * 250 + 2), '.' ,
TRUNC(RANDOM() * 250 + 2), '.',
TRUNC(RANDOM() * 250 + 2), '.',
TRUNC(RANDOM() * 250 + 2)
)::INET;
Written by Anders Brownworth
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Sql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#