54 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
77
views
Postgresql with daterange on the same day
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 ...
2
votes
1
answer
71
views
Cannot add persistent generated datetime column with if statement
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` ...
0
votes
0
answers
123
views
How to have DBMS_STATS.GATHER_TABLE_STATS() Ignore a Virtual Column?
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 ...
0
votes
1
answer
435
views
Postgres `generatedAs` and `storedAs` in Laravel migaration
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) {
$...
0
votes
1
answer
68
views
MySQL: Use column data from other row in output row in same table
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 ...
1
vote
0
answers
24
views
phpGrid-Add a variable to Virtual column (not calculated field)
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 ...
0
votes
2
answers
145
views
mysql virtual column incoherence wrt from_unixtime()
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/...
0
votes
2
answers
1k
views
Google Sheets QUERY with string dates (virtual columns) returns no results
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 ...
0
votes
3
answers
739
views
Show min value of duplicate row value as column value
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 ...
0
votes
0
answers
787
views
How to add Where condition on Virtual column in Typeorm
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
...
0
votes
0
answers
325
views
Making a tricky mysql virtual column
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 ...
7
votes
3
answers
1k
views
Identify if a column is Virtual in Snowflake
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 ...
0
votes
1
answer
652
views
Create a virtual column and index to optimize a filter for an array in a JSON column
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?...
0
votes
0
answers
373
views
Oracle Function-based index v/s Virtual column based index performance
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 ...
1
vote
4
answers
927
views
MySQL: Optimize left join on formatted date
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
...