Skip to main content
Commonmark migration
Source Link

#T-SQL, 133 bytes

T-SQL, 133 bytes

Added some line changes to make it readable

SELECT
SUM(iif('P'=type,nullif(substring(
translate(@,'AVNZMWCUSO','4455662210'),
number,1),substring(@,number,1))-3,0))
FROM spt_values

Try it online

#T-SQL, 133 bytes

Added some line changes to make it readable

SELECT
SUM(iif('P'=type,nullif(substring(
translate(@,'AVNZMWCUSO','4455662210'),
number,1),substring(@,number,1))-3,0))
FROM spt_values

Try it online

T-SQL, 133 bytes

Added some line changes to make it readable

SELECT
SUM(iif('P'=type,nullif(substring(
translate(@,'AVNZMWCUSO','4455662210'),
number,1),substring(@,number,1))-3,0))
FROM spt_values

Try it online

Source Link
t-clausen.dk
  • 3.8k
  • 12
  • 16

#T-SQL, 133 bytes

Added some line changes to make it readable

SELECT
SUM(iif('P'=type,nullif(substring(
translate(@,'AVNZMWCUSO','4455662210'),
number,1),substring(@,number,1))-3,0))
FROM spt_values

Try it online