I want to grab values from a nested table in one table and insert said values into another table Here’s the type for the nested table: The nested table: Here’s the table that contains the nested table: Here’s the table into which I want to insert What I want to do is I want to grab the values from prod_an
Tag: database
One big table or multiple smaller ones? [closed]
I was wondering which approach is better when making a database (ie for a messaging app). Lets say that there is a table with all the messages. is it better to either: Have one large table for all …
Writing SAS dates to SQL Server databse
How to write SAS dates to Microsoft SQL Server 2016 Date data type in database? I got SAS data with a sas date DataEndDay and I want to write that into a database. The following bit is in use (buffer is just to speed up the testing-failing) : Of course because SAS dates are numbers, direct writing is going to
Very slow (12+ hours) large table joins in postgres
I am struggling to optimize a simple LEFT JOIN against two very large tables that so far has been taking > 12 hours to complete and ongoing. Here is the execution plan: Gather (cost=1001.26…..
Search query shows all records when searching in two columns and search word is empty
I am having an issue with a query I am using. There are two things to search for, a category and a searchword, category searches within a category column in my database, but this part of the query is …
I don’t know how to combine my attributes into a single column for this query
My query is to Produce a list of Employees who work for the cinema with the cinema number 07 and include the cinema name in the result. Arrange the result in ascending order by employee surname. Name …
SQL: Sort rows based on attribute order
I want to sort an the value of an attribute (called position) to the row number of another attribute’s ordering. Example: If I have the following attributes: position, points I’d like to order the …
Should there be a foreign key “to” an associative entity, or “from” the associative entity?
I am trying to build a database for a bookstore. The following is a smaller subset of the overall design. Currently I have a Book entity with ISBN (primary key), title, and some others as attributes. …
How to make a foreign key on a different account
So I am currently using my account with username: ctxsys and a password In this account I have table named archiv11. In another account named d5a11 with a password I have a table called fileLocation …
postgresql inner join and left join
I have the following database structure, with postgres 9.5: create table users ( id character varying(255), email character varying(127) ); create table org_users( id character varying(255), …