0

the 'for xml' command does not work on pgadmin. Any ideas? I'm trying to get the following query to work from another stackoverflow question: SQL For xml path on int columns?

select @contactIds = stuff((select ','+cast(id as varchar(8000)) from contacts for xml path('') ), 1, 1, '');

  • 2
    "does not work" is not a problem description. [Edit] your post to quote the precise error in full. Anyway, you're copying code from SQL Server to PostGreSQL; that should not be expected to work as is. – underscore_d Apr 25 '18 at 08:50
  • Thank you. Are you aware of a similar function in postgresql? I am new to SQL and I only have access to pgadmin at work. – emma loves data Apr 25 '18 at 08:55
  • 1
    Please start by explaining *what* you're trying to do, not just *how* you're currently trying to do it. To join some numbers into a comma-separated string, right? Then I'm sure we can find a dupe if we search. – underscore_d Apr 25 '18 at 08:56

0 Answers0