6,192 questions
1
vote
1
answer
73
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
2
answers
112
views
Unique constraint on partitioned table must include all partitioning columns [duplicate]
I'm trying to create this partitioned table in my PostgreSQL database:
create table messages_table (
id bigserial not null,
class_name varchar(255),
date_created timestamp,
service ...
2
votes
1
answer
220
views
std::unique() algorithm returns clearly non-unique results [duplicate]
I have been experimenting with C++'s std::unique() algorithm, but the results it returns really confuse me.
I have done a simple function to test it, like so:
#include <algorithm>
#include <...
1
vote
0
answers
35
views
UNIQUE flag ignored by Doctrine and postgres
I have a Symfony command that adds a bunch of Country entities to my postgres database. The relevant migration is here:
public function up(Schema $schema): void
{
// this up() migration is auto-...
2
votes
1
answer
476
views
Polars check if column is unique
There are multiple ways to check if a column in polars is unique, i.e. it can be used as a key. For example
df.["a"].is_unique().all()
(Selecting with indexing is bad? also I had df.select(&...
1
vote
0
answers
34
views
Pandas Dataframe unique values per group based on label [duplicate]
I have a dataframe with two labels e.g.:
df = pd.DataFrame({'Brand': ['VW', 'VW', 'BMW', 'BMW', 'Mercedes'],
'color': ['red', 'red', 'red', 'blue', 'black']})
>>df
Brand ...
1
vote
1
answer
148
views
Delphi TADOQuery exec for SQL Server stored procedure - exception not caught when multi-column unique index violated
I do use a TADOQuery component to call a stored procedure in SQL Server.
I'm using Delphi 10.1 Berlin and SQL Server 2019 Developer edition.
The code goes like this:
try
DM.OmegaCA_SS.BeginTrans;
...
0
votes
2
answers
57
views
Loop through unique id using difference between dates and time reset in R to obtain unique events [closed]
I have a df in R with multiple events per individual. Each event is currently defined by a unique date. The column diff_earliest_date is the number of days between the earliest date (by unique id) and ...
3
votes
2
answers
397
views
Excel SORT Function in Conjunction With UNIQUE, TOROW & VSTACK
I need to extract unique values from multiple ranges (only two ranges in my example, but more will be added) and display them in a single row, sorted in ascending order, without duplicates.
So far, I ...
5
votes
4
answers
168
views
how to find unique characters both in forward and backward order in R
I have a list of characters like this:
list <- c('a_b', 'a_c', 'a_d', 'a_e', 'a_b', 'b_a', 'b_c', 'b_c','c_b')
I want to have a list of unique characters with no more 'b_a', 'c_b'.
I have tried ...
-4
votes
1
answer
87
views
Analyzing file names
I have large -- several hundred files -- directory that have the file names in the general format of a unique user name (all A-Z and a-z, underlines, no spaces), followed by 2 or 3 numbers, and then ...
0
votes
1
answer
66
views
Google Sheet formula for concatenation [duplicate]
Names
Value
Jack
A2
Jack
A3
Jack
A4
Tom
A5
Tom
A6
How can I join all values in "Value" column in one cell that map to each name in Column Names? Also, have another column that counts the ...
1
vote
1
answer
26
views
Find last occurrence with UNIQUE
There is a vector of numbers:
y = [
2013;
2013;
2013;
2014;
2014;
2015;
2016]
Scilab function unique creates the vector km with indexes of the first occuring unique number in y:
[U, km, ku, nb] = ...
1
vote
4
answers
341
views
Using Excel VBA, how can i extract data from a named table and manipulate the data without changing the data in the original table?
In Excel VBA, I am trying to extract a unique list of values from a column in an named table. I want to store the unique list of values in a variable that I can then use for further processing. I am ...
-1
votes
1
answer
30
views
Python, filter unique but keep all columns
I am trying to filter out unique matches, on a dict with hash tables in.
I have created a filter column. that is a hash of DST+PORT+PROT+SRC. So I just want to filter on the hash.
e.g
[{'DST': '192....
3
votes
1
answer
142
views
Excel Formula: Filter Group based on Smallest Values
Excel Formula
With the use of an Excel (Not VBA) array formula or similar preferably, due to the size and amount of data, I need to reduce the least amount of resources necessary to optimize ...
-1
votes
1
answer
82
views
Extracting unique values from a dynamic range, but repeating each value x times before next unique value
I have been trying to extract unique values from a range and repeat them, for which I've found this existing guide which seems to work:
Extracting unique values from a range, but repeating each value ...
0
votes
0
answers
56
views
Unique ID generation without using GUID
I was trying to think of a way to get unique IDs without using GUID and thought of this. Just wondering what you all think, if it's safe or not, etc.
// IDGEN: an auto incrementing ID for our ...
2
votes
3
answers
129
views
Offsetting duplicate timestamps to make them unique
I have a list of timestamps that I need to offset by a second (or any other small increment of time) if it has a duplicate value on the sheet in order to add a small amount of variance to the ...
0
votes
0
answers
80
views
composite unique key validation - laravel 11
Here i given below my table schema
Schema::create('yarn_work_order_items', function (Blueprint $table) {
$table->id();
$table->foreignId('yarn_work_order_id')->constrained('...
-1
votes
1
answer
31
views
how to change the data if the result is not found to 0
> =IFERROR(COUNTUNIQUE(FILTER('MASTER DATA'!Y:Y,
> ('MASTER DATA'!Y:Y <> "") *
> (('MASTER DATA'!M:M = "SURVEY") + ('MASTER DATA'!M:M = "PI")) *
> ('...
0
votes
1
answer
29
views
Comparing a selection
Hi please can you help.
I'm trying to select the last 200 rows in my database, then compare 2 fields in each row, and return each whole row where there is only 1 instance. So, all rows that have more ...
0
votes
0
answers
113
views
Bitnami Airflow chart 19.0.3 (Airflow version 2.10) not creating pods with unique names
Reason: Conflict
HTTP response headers: HTTPHeaderDict({'Audit-Id': 'd4e76ef2-4512-4e87-a2e6-bb413059a56b', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Kubernetes-Pf-...
-1
votes
2
answers
123
views
Remove Duplicates from Very Large Array, Keeping Oldest Timestamp
I have a large dataset (400K+ rows by 4 columns). I'm currently grabbing the data into an array using the following (thanks to tanaike):
function getValues_({ spreadsheetId, sheetName, start = 1, ...
0
votes
1
answer
41
views
Database import
I tried importing a file (database.sql) to my DB server and I get this error:
All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE insteadapp/config/database.sq|CREATE ...