Questions tagged [database-view]

64 questions
0
votes
2 answers

Distinct on column using custom order

I have a DB view. At this point it returns rows which can have duplicate entries in id column. I would like to do the following: SELECT DISTINCT ON (id) USING DESCRIBED BELOW RULE -- of course it is not valid sql id type type column can have 3…
Andrey Deineko
  • 51,333
  • 10
  • 112
  • 145
0
votes
2 answers

Error inserting multiple rows into View with INSTEAD OF trigger

I have a Map table that stores a location using a GEOGRAPHY type. Since Entity Framework Core doesn't support spatial types, I have to map a MapView view instead with Lat and Long columns in my application. I then transform these Lat and Long values…
Valuator
  • 3,262
  • 2
  • 29
  • 53
0
votes
1 answer

MySQL Error target table *view* of the UPDATE is not updatable

This is the query I am trying to run UPDATE `jobseeker_view` SET `is_deleted` = 'Yes' WHERE `id`= '614' On Local it works fine but on production database it doesn't work and throws this error: #1288 - The target table jobseeker_view of the UPDATE…
Shreejibawa
  • 1,860
  • 1
  • 25
  • 35
0
votes
1 answer

SQL Server - Creating view by not having declare statement in the query

I have created query for converting vertical table data into horizontal, and I have a declare statement in my query. I have to create a view based on my query, but I get an error from SQL Server since I have a declare statement in my query. The…
charmy
  • 5
  • 2
0
votes
1 answer

Database view performance issue versus underlying query

I'm noticing a difference in performance between a View and the underlying Select statement that produces that view. When the View is created, it does a table scan across all of the underlying tables (some 7 million rows), but the Select statement…
0
votes
1 answer

MongoDB Projection Works In Query, But Does Not When Creating A View

I have a MongoDB database called "Test". In this database I have a collection of people in the "People" collection. The people collection contains an array of the following documents: class Person{ public int Id { get; set; } public…
dacke.geo
  • 233
  • 2
  • 13
0
votes
1 answer

output sql with html structure

Is there a way to store the HTML structure in a SQL view and output it with the stored HTML structure via controller? For e.g. Here is a sample HTML which I'd like to store in a SQL View and output via controller <%@ Page Language="C#"…
user793468
  • 4,898
  • 23
  • 81
  • 126
0
votes
1 answer

Rails: how database view works with active records

I'm new in Rails. In one source code, I see that someone create some rake tasks related to create view. For example: desc 'create statistic data' task create_product_statistics: do ActiveRecord::Base.connection.execute <<-SQL CREATE VIEW…
Trần Kim Dự
  • 5,872
  • 12
  • 55
  • 107
0
votes
1 answer

MySql - Create view by merging two tables based on values

I have two tables: financials_standalone ('fin_id', 'attr_id', 'year', 'value'); financials_consolidated ('fin_id', 'attr_id', 'year', 'value'); ('fin_id', 'attr_id', 'year') is the unique key financials_consolidated table will have data in…
Prathab K
  • 89
  • 5
0
votes
1 answer

TYPO3 Extension: create database view during installation

In my TYPO3 extension I use a foreign table. I've created 2 views providing data of this table in the manner my extension needs. The question is - how can these views be created at installation time? Views defined in "ext_tables.sql" are ingored…
firelex
  • 129
  • 11
0
votes
1 answer

Rails how to pass parse data from sql view to model?

I followed the excellent post from Frank Rietta about "Adding a Rake Task for SQL Views to a Rails Project". I like his point of view about database views in rails and his dry approach. I am able to do rake db:views and my view is created but I am…
agusgambina
  • 6,229
  • 14
  • 54
  • 94
0
votes
1 answer

Need assistance with creating view in my database sql

I'm trying to build a view based on the schema I have. But right now I am completely lost where to start. My view should consists of information about the player their(LINKING) guardian, guardian's phone number and what team they currently playing.…
penguin.25
  • 23
  • 3
0
votes
0 answers

create view in postgresql containing table with many2many field

I created a view containing some audit attributes: class audit_performance(osv.Model): _name = "audit.performance" _auto = False _description = "Audit performance Analysis" _inherit = ["audit", "action"] def init(self, cr): …
Tessnim
  • 434
  • 9
  • 29
0
votes
1 answer

Insert records in chunk to mysql view

I have created empty view with following query: CREATE VIEW `test` AS select * from `configurations` where 0; Consider configurations table have 100 records with primary key id starting from 0 to 100. I would like to insert data in view with chunk…
Parixit
  • 3,829
  • 3
  • 37
  • 61
-1
votes
1 answer

How to model SQL Server database view in Visual Studio using EF Core?

I created a view in SQL Server. I want to model that view in Visual Studio using EF Core as the ORM with a database-first approach. I appreciate if anyone can tell me about the solution.
hrz
  • 193
  • 5
  • 17