Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
74 views

I'm trying to create a virtual column called period created by 2 other columns starting_date (time) and ending_date (time). The aim is to avoid overlapping of periods for the same user. Here is my ...
brcebn's user avatar
  • 1,772
2 votes
1 answer
68 views

I'm confused at the behaviour of persistent generated columns in Mariadb when it comes to IF statements and dates. The following works: CREATE TABLE `test1` ( `date` datetime(3), `generated` ...
James Waters's user avatar
0 votes
0 answers
119 views

Is there a way to instruct dmbs_stats.gather_table_stats() to ignore a particular column? Context: I have a table that has a virtual column that performs a standard_hash() of the concatenation of ...
Alex Bartsmon's user avatar
0 votes
1 answer
420 views

I have this migration. I am using Postgres, I found that generatedAs and storedAs are supported by Postgres.. I am a beginner in Postgres. Schema::create('users', function (Blueprint $table) { $...
Watheq Alshowaiter's user avatar
0 votes
1 answer
67 views

I have a table with categories and subcategories, linked together with column 'cat_parent' which has the parent category id in it. When I search for something I would like the result to include its ...
Paul's user avatar
  • 51
1 vote
0 answers
23 views

I have read the phpGrid documentation and tested several other scripts but I cannot get a virtual column populated with just test or a static variable. I looked at Add static column in phpgrid ...
Joey Martin's user avatar
-1 votes
0 answers
46 views

I have a QStandardItemModel where each item manages a database entity, so every row has one column and the rows adjust matching to the database events. Now I want to generate a table from one subtree ...
h-c's user avatar
  • 52
0 votes
2 answers
144 views

Got a table with a virtual column using from_unixtime(): CREATE TABLE aa ( id int NOT NULL AUTO_INCREMENT, epochmillis bigint, session_dt DATETIME(3) generated always as (from_unixtime(epochmillis/...
user2023577's user avatar
  • 2,161
0 votes
2 answers
1k views

Problem Statement I am trying to run a QUERY on a large data set, but cannot get my QUERY to return any data. It keeps giving me this error: "Query completed with an empty output". The crux ...
steeveesas's user avatar
0 votes
3 answers
736 views

More detailed question. I have a table called CALCS with the structure: code is the record identifier (not unique) value1, value2, value3,value4 are different values to sum price is the cost of work I ...
oraculo's user avatar
  • 13
0 votes
0 answers
784 views

Can someone help me in below query I always get x.salesChannel as Unknown column SELECT Column1, Column2, ( SELECT CASE WHEN `cr`.`CRColumn` is not null ...
Manjari's user avatar
0 votes
0 answers
324 views

am trying to use mysql virtual columns feature to achieve a search mechanism where i have booking numbers may be a real integer like 101 or an alpha numeric as A101 , B101 etc. So i do need to make a ...
Emad  Rashad Muhammed's user avatar
7 votes
3 answers
1k views

Snowflake does not document its Virtual Column capability that uses the AS clause. I am doing a migration and needing to filter out virtual columns programatically. Is there any way to identify that ...
Rob D's user avatar
  • 161
0 votes
1 answer
648 views

Here is the microsoft document for how to optimize a json column with out using OpenJson and only using Json_Value: https://learn.microsoft.com/en-us/sql/relational-databases/json/index-json-data?...
Jonathan Rostami's user avatar
0 votes
0 answers
369 views

I have a production table that has 2.5 Billion rows. It has a column "created_date", which has both date and time components. The table is not partitioned. I have to export 2 months of data ...
Jay's user avatar
  • 87
1 vote
4 answers
924 views

I'm trying to optimize the speed of this query: SELECT t.t_date td, v.visit_date vd FROM temp_dates t LEFT JOIN visits v ON DATE_FORMAT(v.visit_date, '%Y-%m-%d') = t.t_date ...
Sempervivum's user avatar
1 vote
0 answers
394 views

We've recently moved to use Oracle.ManagedDataAccess in our application now it supports Bulk Copy. The problem is it seems to have a hard time dealing with tables that have virtual columns where the ...
Brandon Billingham's user avatar
0 votes
1 answer
90 views

I want to make database calculate a column. For example: There is a column named 'price'. every time I insert a new value into the price, I want another column named 'percent' automatically calculate ...
Ozgeozcn's user avatar
1 vote
1 answer
2k views

According the the documentation, MariaDB allows user defined functions to be used in generated column definitions https://mariadb.com/kb/en/generated-columns/ User-defined functions (UDFs) are ...
Ryan's user avatar
  • 132
2 votes
0 answers
352 views

Problem statement I've a big table users composed of 2 different kinds of users, A and B. At the moment, they share some fields, while other fields are A-only or B-only. Now, normally with a proper ...
Joseph's user avatar
  • 1,101
3 votes
1 answer
1k views

I am trying to do a groupby virtual column in a Druid native query which looks like this... { "queryType": "groupBy", "dataSource": "trace_info", "...
PhaKuDi's user avatar
  • 141
4 votes
2 answers
746 views

PostgreSQL 12 has a cool Generated Columns feature but I can't check whether column is virtual or not in Rails. For reference, MySQL Adapter in Rails allows you to do like MyModel....
Al17's user avatar
  • 430
0 votes
0 answers
1k views

I have to map a table using JPA, but this table has a multicolumn key with some of that as Oracle virtual columns. When I try to make the insert, Hibernate (the implementation of JPA that I've used) ...
Giuseppe Caiazzo's user avatar
1 vote
2 answers
349 views

I have TableA that has hundreds of thousands of rows and is still increasing in size. With no partitions, the speed has decreased very noticeably. So I made a new table called TableB made columns ...
Jett's user avatar
  • 912
1 vote
1 answer
990 views

I have an Interface which's created with Oracle Forms. It has a base table block in which there's a field (namely col3"has the same name with the table's column that's derived from"). Form has two ...
Barbaros Özhan's user avatar
0 votes
0 answers
2k views

I would like to modify an existing column of my table in a virtual column. By opening the "SQL" tab in Oracle SQL Developer, the current column is (table DDL): "ENABLED" NUMBER(1,0) DEFAULT '1' I ...
Maurizio Rizzo's user avatar
2 votes
1 answer
256 views

After googling for a while , I am posting this question here since I was not able to find such a problem posted anywhere. Our application has a table with 274 columns(No LOB or Long Raw columns) and ...
Rammy's user avatar
  • 31
5 votes
2 answers
4k views

I have a MySQL alter statement ALTER TABLE `employee` ADD `employee_name_generator` CHAR(20) GENERATED ALWAYS AS  (COALESCE(concat(`employee_name`), '^')) VIRTUAL; This is needed for adding ...
user9920500's user avatar
1 vote
2 answers
279 views

I have a huge table with data and i need to partition the table based on the the below requirement. The records will be inserted every half an hour for each id.we have around 5000 id's. I have a id(...
user2899615's user avatar
0 votes
0 answers
338 views

Is it possible to create virtual columns in Teradata, that is, columns based on the values of another columns of the same table, for example: CREATE SET TABLE TEST.ZZ_RECEIPTS, NO FALLBACK , ...
RufusSC2's user avatar
  • 273
1 vote
2 answers
4k views

Is it possible to create a generated MySQL column that runs a condition on other columns? For example: column "a" - type boolean column "b" - type date generate column "c" that implements the logic: ...
shugigo's user avatar
  • 173
1 vote
0 answers
866 views

I have these two tables called "Timelines" and "Universes". In "Timelines" I have a column named "ID" which must be a combination of a Timeline's ID after the ID of its related Universe. For that ...
user avatar
0 votes
0 answers
111 views

I'm working with Oracle table containing column of XMLType. I found that it is virtual but when I was creating the table the column was not marked with "virtual" property. So my question is why this ...
Denis's user avatar
  • 145
0 votes
1 answer
1k views

Let me explain . I have a json data set with values something like this: "clientRequest": { "uri": "/flow.php?id=FS-6097&utm_source=facebook&utm_medium=cpc&utm_term=cold", ...
RashFlash's user avatar
  • 1,012
0 votes
1 answer
660 views

I have table TEST_ORD where i have column ORD_DAYID which is virtual column. I want to know from where and how the value in this coumn is populating. Because i cant use this column in insert statement ...
Marcus's user avatar
  • 4,011
2 votes
3 answers
23k views

I dont understand the below issue where i am trying to insert the query and getting error as Insert operation disallowed on virtual columns. I took a export from production in sql developer and i ...
Marcus's user avatar
  • 4,011
0 votes
0 answers
39 views

I have a table T1 with a virtual column V1 which is generated automatically based on some condition and also a foreign key is created with Column C1 of table T2. Now when table T1 is locked and I try ...
user3174910's user avatar
1 vote
1 answer
1k views

This is an attempt to the test the usage of the VIRTUAL column with a function to increment the value in a column. I am using a function which would return the last two digits of the current year, ...
Jacob's user avatar
  • 14.8k
3 votes
1 answer
1k views

I am trying to create a table with a timestamp column and a virtual (calculated) column that holds a helper key for grouping the rows with timestamps of the same hour. For that I am using the ...
Claude's user avatar
  • 31
1 vote
1 answer
806 views

I have this trigger create or replace trigger upd_totprc_trg after insert or update or delete of total_price on sales_detail for each row declare v_diff number := 0; v_master number; begin if ...
hermione's user avatar
0 votes
1 answer
176 views

In MySQL 5.7.11, adding a composite index where one of the columns is a virtual generated column results in the following error: Error Code: 3175. Cannot create index on virtual column whose base ...
oulenz's user avatar
  • 1,264
7 votes
1 answer
2k views

I'm working with MySQL 5.7. I created a table with a virtual column (not stored) of type DATETIME with an index on it. While I was working on it, I noticed that order by was not returning all the data ...
Stefano Giacone's user avatar
0 votes
2 answers
2k views

I am using a virtual column (oracle 11g) with a deterministic user defined function which takes primary key of the row as parameter and returns a simple scalar value. the virtual columns updates ...
jaykio77's user avatar
  • 391
0 votes
1 answer
293 views

Is it possible to change a virtual column value based on a where clause? I have this table: [computername] [computerlocation] [starttime] [endtime] computer, siteA, 1457537657, ...
Josh Budd's user avatar
2 votes
1 answer
2k views

I have an SQL query, which calls a stored SQL function, I want to do this: SELECT dbo.fn_is_current('''{round}''', r.fund_cd, r.rnd) as [current] FROM BLAH WHERE current = 1 The select ...
Brian Postow's user avatar
  • 12.3k
2 votes
1 answer
94 views

In one environment on 11G, I have created a table with one virtual column as follows create table TEST_VIRTUAL_COL( col1 number(5), col2 varchar2(10), col3 number generated always as((-1)) ...
Rohit G's user avatar
  • 39
13 votes
3 answers
10k views

Have some tables: CREATE TABLE `asource` ( `id` int(10) unsigned NOT NULL DEFAULT '0' ); CREATE TABLE `adestination` ( `id` int(10) unsigned NOT NULL DEFAULT '0', `generated` tinyint(1) ...
alik's user avatar
  • 2,393
0 votes
0 answers
336 views

I know I can select a single value using SELECT 'value' AS col; But I need return a list of numbers as a column. Something like SELECT ('value1', 'value2', 'value3') AS col; More precisely I need ...
Alan Alves de Oliveira's user avatar
0 votes
3 answers
2k views

I want to create an alphanumeric sequence in oracle. Table name is rel_details it consists of four columns. rel_id rel_name rel_modified_date rel_desc In rel_id i want to generate ID like ...
Tapajyoti Giri's user avatar
3 votes
1 answer
3k views

I can add virtual columns as SELECT '1' as id | id | ------- | 1 | But I want add multiple values, example: SELECT ('1','2','3') as id | id | ------- | 1 | | 2 | | 3 | But this don't work
Piotr's user avatar
  • 31