![]() ![]() Postgres '# text_output := text_output || row_data. Postgres'# FOR row_data IN SELECT * FROM books Postgres '# text_output = text_output || ' '' ' || sub_title || ' ':'' Postgres'# SELECT INTO sub_title subject FROM subjects WHERE id = i Our PL/SQL tutorial includes all topics of PL/SQL language such as conditional statements, loops, arrays, string, exceptions, collections, records. Postgres=# CREATE FUNCTION "extract_all_titles2" () RETURNS text AS ' Postgres=# drop function extract_all_titles2() Postgres=# insert into subjects values (15, 'Science Fiction', 'Main St') Postgres=# insert into subjects values (14, 'Science', 'Productivity Ave') Postgres=# insert into subjects values (13, 'Romance', 'Main St') Postgres=# insert into subjects values (12, 'Religion', 'Regina') Postgres=# insert into subjects values (11, 'Poetry', 'Sunset Dr') Postgres=# insert into subjects values (10, 'Mystery', 'Black Raven Dr') Postgres=# insert into subjects values (9, 'Horror', 'Black Raven Dr') ![]() Postgres=# insert into subjects values (8, 'History', 'Academic Rd') Postgres=# insert into subjects values (7, 'Entertainment', 'Main St') Postgres=# insert into subjects values (6, 'Drama', 'Main St') Postgres=# insert into subjects values (5, 'Cooking', 'Creativity St') Postgres=# insert into subjects values (4, 'Computers', 'Productivity Ave') Postgres=# insert into subjects values (3, 'Classics', 'Academic Rd') Postgres=# insert into subjects values (2, 'Children', 'Books Kids Ct') Postgres=# insert into subjects values (1, 'Business', 'Productivity Ave') Postgres=# insert into subjects values (0, 'Arts', 'Creativity St') NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "subjects_pkey" for table "subjects" Postgres(# Constraint "subjects_pkey" Primary Key ( "id") Postgres=# insert into books values (41472, 'Practical PostgreSQL', 1212, 4) Postgres=# insert into books values (41478, 'Perl Cookbook', 7806, 4) Postgres=# insert into books values (41477, 'Learning Python', 7805, 4) Postgres=# insert into books values (41473, 'Programming Python', 7805, 4) Postgres=# insert into books values (156, 'C++', 115, 9) Postgres=# insert into books values (2038, 'C', 1644, 0) Postgres=# insert into books values (190, 'Java by API', 16, 6) ![]() Postgres=# insert into books values (1501, 'Python', 2031, 2) Postgres=# insert into books values (25908, 'Postgre SQL', 15990, 2) Postgres=# insert into books values (1590, 'Sql Server', 1809, 2) Postgres=# insert into books values (1608, 'Oracle', 1809, 2) Postgres=# insert into books values (4513, 'Javascript', 1866, 15) Postgres=# insert into books values (7808, 'Java', 4156, 9) NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "books_id_pkey" for table "books" Postgres(# Constraint "books_id_pkey" Primary Key ( "id") Nested for loop : For « Postgre SQL « PostgreSQL ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |