Skip to content
Advertisement

Tag: view

How to create a view using data from two tables

I have two tables ITEM id (int), model (varchar), weight (float), fk_type (int) TYPE id (int), name (varchar) And I want to create a view with TypeName (for every type name) –> varchar NumberOfItems (total number of ITEMS for TypeName) —> int NumberOfModels (total number of MODELS for TypeName) —> int TotWeight (again sum of all the ITEMS weight per

Select info from row to another row

I have this select on a view: And get this: And I want that the last row be like this: That is, the values of all columns equal to the other rows, except column ‘C’ and column ‘D’. The value of column D is obtained from T2.D How can I do? Thanks. Answer Without any sample data to use I

PostgreSQL: `VIEW` returns no rows with `SPLIT_PART()` columns

Problem Description: Hi everyone, I’m having some troubles querying on a VIEW whose columns are, in part, the result of SPLIT_PART() function on og table’s column; I created the VIEW as it follows: My intention was to divide the structured attribute (Clients.Address defined as a string VARCHAR(255)) which contains all the informations releated to client’s domicile in several columns to

Advertisement