The demand is such that a record number requires "P" and then followed by the annual annual "-" and primary key IDs, such as: P2004-123. SQL statement writes this:
Select 'p' || to_char (a.createtime, 'YYYY') || '-' || A.id As Number from Person A
There is also a way to use "CONCAT (STR1, STR2)" instead of "||"
Note: Please teach the old horse and Liu XX.