Last active
May 4, 2023 02:49
-
-
Save er2/a34f3245229bba9821261bc50def5ef7 to your computer and use it in GitHub Desktop.
HTML from SQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create function home() returns XML | |
language sql as $$ | |
select xmlelement(name table, | |
xmlelement(name th, 'Column 1'), | |
xmlelement(name th, 'Column 2'), | |
xmlagg( | |
xmlelement(name tr, | |
xmlforest(column_one as td, | |
column_two as td)))) | |
from home_page_content; | |
$$; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment