Use ROW_NUMBER() function better for order and partition by multiple columns. SELECT name, category, ROW_NUMBER() OVER (PARTITION BY name, category ORDER BY name, category) unique_id FROM test; name | category | unique_id :--- | :------- | --------: A | Alpha | 1 A | Alpha | 2 A | Alpha | 3 A | Beta | 1 A | Beta | 2 B…
SQL Server
Answered Mar 20, 2023
·
23.7K Views
Read answer →
SQL Server
Answered Mar 14, 2023
·
815 Views
Read answer →
Postgresql insert multiple rows with default values for all columns- Using generate_series() and ctes. Tested in rextester.com:create table t ( tid serial primary key, i int default 0, name text default 'Jack' ) ;with ins as (insert into t (i, name) -- all the columns except any serial values (default, default)…
SQL Server
Answered Mar 10, 2023
·
1.8K Views
Read answer →
To resolve the error 1045 (28000): access denied for user 'root'@'localhost' (using password: yes) - sudo dpkg-reconfigure mysql-server-8.0 ( use sudo dpkg --get-selections | grep sql to get your version) completely remove MySQLconfig and data? sudo rm -r /var/lib/mysql (Users and passwords (including the root…
Salesforce
Answered Mar 7, 2023
·
8.0K Views
Read answer →
In such a scenario - failed to execute 'todataurl' on 'htmlcanvaselement': tainted canvases may not be exported. I took your code and used 'plyr' CDN instead of static resource and it worked for me. Below is my working code which did not show the error thum:50 Uncaught DOMException: Failed to execute 'toDataURL' on…
Salesforce
Answered Mar 6, 2023
·
1.7K Views
Read answer →
To create an apex class that returns contacts based on incoming parameters - The parameters you have passed to the method are not getting utilized in the logic of the method. In the below line of code, You have passed the value as a static string in the where clause of your query and not as a variable.list…
Salesforce
Answered Mar 1, 2023
·
1.5K Views
Read answer →
Yes, using a salesforce identity license is possible. For every experience cloud site you use, it can act as an IDP. This includes external users linked to the site. Here are the steps to enable communities as IDP, note it is very similar to the regular salesforce as IDP. Create my domain for your organisation. It is…
Salesforce
Answered Feb 23, 2023
·
920 Views
Read answer →
We can use validation rules here to get the code coverage caught in test class. Check Contact validation rules which can fire at contact update. Create contact with those values which will be used to fire validation rules. So you can get DML exceptions here. if you don't have any validation rules to fire at Contact…
Salesforce
Answered Feb 23, 2023
·
3.7K Views
Read answer →
Data Science
Answered Feb 15, 2023
·
876 Views
Read answer →
To use pandas groupby multiple columns, you could perhaps generate the dictionary using a list comprehension style syntax. E.g. df2 = df.groupby(['name']).agg({col: 'first' if i
Data Science
Answered Feb 14, 2023
·
1.1K Views
Read answer →
The definition of VC dimension is: if there exists a set of n points that can be shattered by the classifier and there is no set of n+1 points that can be shattered by the classifier, then the VC dimension of the classifier is n. The definition does not say: if any set of n points can be shattered by the classifier...…
Data Science
Answered Feb 14, 2023
·
1.1K Views
Read answer →
To get the train test validation split, you could just use sklearn.model_selection.train_test_split twice. First to split to train, test and then split train again into validation and train. Something like this: X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=1) X_train, X_val,…
Data Science
Answered Feb 13, 2023
·
840 Views
Read answer →