All Questions
Tagged with generated-columns or calculated-columns
2,388 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
2
answers
156
views
Clustered columnstore index with computed column -- why does segment elimination not work?
Recent versions of Microsoft SQL Server allow creating a clustered columnstore index on a table that has computed columns, as long as they are not persisted computed columns. [1]
I would like to get ...
-1
votes
1
answer
67
views
ASP.NET Core MVC : where in the controller to put the calculation of day difference, and how to then show in Index View [closed]
I need to be able to calculate the number of business days difference between two dates: from DateRequestMade to DateIssued. I have used this code that I found:
var calculatedBusinessDays =
1 + ((...
1
vote
1
answer
81
views
Calculate quantity based on column from a different table
I currently am working with 2 tables tbRecords and tbInspectedParts. tbRecord has an auto increment column that is mapped back to the tbInspectionParts through column eRecordId.
Example - tbRecord:
...
2
votes
2
answers
259
views
Generated column with data type timestamptz (timestamp with time zone)
In PostgreSQL, I want to make a computed column, where end_datetime = start_datetime + minute_duration adding an interval to a timestamp.
I keep getting error, how can I fix?
ERROR: generation ...
2
votes
1
answer
81
views
How can I summarize sales data by category in a new column?
I would like to create a new column where I can sum units by quarter.
My table like this
Another column I would summ unit by product and quarter
Edit: Last two col with the expected result
Unit
...
-2
votes
1
answer
47
views
How can I insert data into virtual json columns in mysql? [duplicate]
How can I insert data into virtual json columns in mysql?
I am creating a table that has a jsonData field and a virtual id column.
CREATE TABLE table_json(
JsonData JSON NOT NULL,
id INT ...
1
vote
0
answers
55
views
How to show "PAST" (before today) + next 12 months with MMM X-axis labels
I'm trying to build a bar chart in Power BI where the X-axis shows the following:
A "PAST" bucket representing all data before today
The next 12 months, displayed as 3-letter month names ...
1
vote
1
answer
78
views
In maria db how do I create a table with a column generated by my sql function?
In Maria database 10.6.22 on ubuntu 24.04, I wrote a function to unaccent utf8 fields. It works fine when I apply it to column entries, but I want to use it to generate an unaccented column in a table ...
2
votes
1
answer
127
views
Why is timestamptz + interval considered mutable?
I tried to create a generated column that adds timestamptz and interval columns, but Postgres complains that this expression is immutable:
create table test ( ...
0
votes
0
answers
15
views
Sum Unique Hours in a table
My dataset has an Employee that has taken many trainings, but has also worked some {Hrs} on the same day. I want to get the sum of {hrs}, as a calculated field, that the employee has worked, where the ...
2
votes
5
answers
122
views
Mean of every n columns for each row in R
I have a monthly dataset of 36 IDs for 23 years. I am trying to calculate the annual means for each ID. Please see a subset of the data below.
structure(list(ID = c("AN", "AP", &...
0
votes
2
answers
78
views
Getting single MAX() row of Calculated Column within a Specific Time Interval in SQL
I am trying to get the MAX() of the sums of amps_a + amps_b + amps_c within the month of March for the ID column. This should return a single row for the highest sum for the month of March (or at ...
-2
votes
1
answer
54
views
combine two date columns - sort of Role Playing Dimensions
I have a scenario in Power BI:
I have a simple Transaction Table, with Order and Delivery years in two columns, with an Amount column.
I do not care about the ProductId column for my visuals; the ...
0
votes
1
answer
71
views
RANK() Always Returns 0 in SeaORM Query
I am using SeaORM in a Rust project and trying to retrieve ranked user balances using MySQL’s RANK() OVER (ORDER BY ...). However, the rank field always returns 0 for all rows.
Rust Code:
#[allow(...
1
vote
0
answers
36
views
Is there a way in Tableau to go through a series of numbers in a field (delimited by ",") then do a lookup for each from another data source?
I have a series of IDs in a Tableau column that I need to derive the actual names from another data source (like a vlookup or join via the ID), and display the actual names on a new Tableau field. See ...