CREATE TABLE table_31145 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Original air date" TEXT, "Production code" FLOAT)

How many episodes were written by Gregg Mettler?
SELECT COUNT("No. in series") FROM table_31145 WHERE "Written by" = 'Gregg Mettler'
SELECT COUNT("No. in series") FROM "table_31145" WHERE "Written by" = 'Gregg Mettler'