Count numbers in scientific notation (E-notation) I'm trying to check if a part number field has scientific notation values and came up with this simple solution:
SELECT count(*) as overall,
       count(*) filter (where partnumber ilike '%E+%') as matches
FROM   mytable
WHERE  partnumber ilike '%E+%';

Some of these strings are not scientific number. For example:
WS-X4748-UPOE+E=

How can I identify scientific numbers?
I tried this:
WHERE partnumber ilike '[0-9]%E+%[0-9]'

But it didn't seem to work.
This would do it:
SELECT count(*) AS overall
     , count(*) FILTER (WHERE partnumber ~* '^[-+]?\d*\.?\d+e[-+]?\d+$') AS matches
FROM mytable
-- WHERE .. -- no outer WHERE

~* is the case-insensitive regular expression match operator.
The pattern'^[-+]?\d*\.?\d+e[-+]?\d+$' only applies to numbers in E-notation (without blanks).
Details in the manual.