There is a request, I tried to make it ...
SELECT "news".id,"news".uri,"news".title,"news".date, replace( replace( replace( replace("news".uri,'http://www...ru/gal.php?cat=',''), 'http://www...ru/gal.php?pr=',''), 'http://...ru/gal.php?pr=', '' ),'http://www...ru/pr.php','' )::integer AS photorep FROM news W1 JOIN pr_photoreport W2 ON W2.id = W1.photorep WHERE "news".uri <> '' In general, it is necessary that he did not swear. in the line ON W2.id = W1.photorep it cannot understand why photorep does not exist, how can this be corrected?
ON replace( replace( replace( replace(W1.uri,'http://www...ru/gal.php?cat=',''), 'http://www...ru/gal.php?pr=',''), 'http://...ru/gal.php?pr=', '' ),'http://www...ru/pr.php','' )::integer = w2.idhe probably does not understand aliases from the list of select fields - Sergey