The following are query results are from two different tables in the same database, both id columns are integer. How should I remove the number 16789 from the first table id to match the second id?
news=> select id from log limit 10;
   id
1678923
 1678924
 1678925
 1678926
 1678927
 1678928
 1678929
 1678930
 1678931
 1678932
(10 rows)
news=> select id from articles limit 10;
id
23
 24
 25
 26
 27
 28
 30
 29
(8 rows)
In the database:
SELECT
 TRIM (
 LEADING '16789'
 FROM 1678929
 CAST (news AS TEXT)
 ); -- 29
How do I remove part of the number from psql query return?