unique-index Questions

1

Solved

I have a pojo with two fields that need to be unique, the id and the email. So I added the @Indexed(unique = true) annotation to the necessary fields like so public class User { @Id @Indexed(uniq...
Amado asked 21/10, 2021 at 16:12

3

Solved

A unique index ensures that the values in the index key columns are unique. A unique constraint guarantees that no duplicate values can be inserted into the column(s) on which the constraint is cre...
Bornu asked 17/10, 2018 at 9:43

2

Solved

When I run this query ALTER TABLE "dbo"."ROOM" DROP INDEX "UNIQUE"; I got this message: Error 1018: Incorrect syntax near 'INDEX'. If this is intended as a part of a table hint, A WITH keywor...
Debbee asked 6/3, 2015 at 18:59

16

Solved

I want to create a unique id but uniqid() is giving something like '492607b0ee414'. What i would like is something similar to what tinyurl gives: '64k8ra'. The shorter, the better. The only require...
Amorphous asked 21/11, 2008 at 1:5

7

Solved

What is the diffrence between a unique index and a unique key?
Festoon asked 25/9, 2010 at 16:49

9

Solved

I've seen a number of variations on this but nothing quite matches what I'm trying to accomplish. I have a table, TableA, which contain the answers given by users to configurable questionnaires. T...
Fideicommissary asked 26/12, 2012 at 21:15

5

Solved

I'm getting an error running the following Transact-SQL command: CREATE UNIQUE NONCLUSTERED INDEX IX_TopicShortName ON DimMeasureTopic(TopicShortName) The error is: Msg 1505, Level 16, State ...
Nazario asked 1/2, 2010 at 23:28

4

Solved

I am trying to drop an index : DROP INDEX PK_CHARGES but I get this error cannot drop index used for enforcement of unique/primary key Why I am getting this error? I will provide further i...
Gormless asked 15/7, 2013 at 7:18

1

Solved

Is it possible to create a filtered index in SQL Server with multiple conditions? Here is what I am trying to do, but gives 'incorrect syntax' error: CREATE UNIQUE NONCLUSTERED INDEX IX_TestTabl...
Lianaliane asked 18/9, 2017 at 10:55

1

Should I create unique index if a column contains unique constraint and I want to fast search by this column? For example I have a table users with column login that should be unique. I need fast...
Eusebioeusebius asked 23/6, 2018 at 18:23

1

Is it possible to create to create a unique index or other kind of constraint in PostgreSQL, that would be checked on transaction COMMIT and not a millisecond earlier? I need an index for a...
Shrubbery asked 30/4, 2018 at 10:39

4

Solved

I inserted between two tables fields A,B,C,D, believing I had created a Unique Index on A,B,C,D to prevent duplicates. However I somehow simply made a normal index on those. So duplicates got inser...
Conduct asked 15/4, 2016 at 12:22

4

Solved

I’m interested in learning which technique developers prefer to use to enforce uniqueness in SQL Server: UNIQUE CONSTRAINT or UNIQUE INDEX. Given that there is little difference in the physical imp...
Jarvisjary asked 21/7, 2010 at 4:2

2

Solved

I've searched around but I can't seem to find an appropriate explaination behind the concept of unique and non unique indexes in a database. In Rails, for example, you can create unique and non un...
Prickett asked 20/10, 2014 at 11:16

1

I created a unique index (case description should be unique if IsDelete != 1) CREATE UNIQUE NONCLUSTERED INDEX [UniqueCaseDescription] ON [tblCases] ([fldCaseDescription] ASC) WHERE [IsDeleted] =...

1

Solved

There is a column status in a Postgres table which can take only two values: Active and Inactive. One of the columns is named userid. The table can have multiple rows with the same userid but at m...
Plainsong asked 28/12, 2015 at 14:36

3

Solved

Here i like to explain my problem, I Need to Create Unique Index in my Existing table, and the table contains many records. I tried to execute this code CREATE UNIQUE INDEX empid_name ON employe...
Miscalculate asked 27/10, 2015 at 6:32

6

Solved

I have a registration form in which users can fill in two email address (email1 & email2). Marketing's requirement is that they need to be unique (unique as in if we had 10 users, then there wo...
Whacky asked 17/3, 2010 at 9:59

3

Solved

describe etc_category_metadata; +---------------------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------------+-------------...
Ordure asked 30/8, 2015 at 6:51

3

Solved

Given the following schema: CREATE TABLE identifiers ( id TEXT PRIMARY KEY ); CREATE TABLE days ( day DATE PRIMARY KEY ); CREATE TABLE data ( id TEXT REFERENCES identifiers , day DATE REFERE...
Counterirritant asked 21/3, 2015 at 1:34

1

Solved

Not sure if this is possible in PostgreSQL 9.3+, but I'd like to create a unique index on a non-unique column. For a table like: CREATE TABLE data ( id SERIAL , day DATE , val NUMERIC ); CREATE...
Cowles asked 20/3, 2015 at 16:40

1

Solved

I have a SAMPLE_TABLE with a column BIZ_ID which should be unique when the column active is not equal to 0. On an oracle database the index looks like this: CREATE UNIQUE INDEX ACTIVE_ONLY_IDX ...
Histaminase asked 3/3, 2015 at 16:21

2

Solved

I have a user collection in a MongoDB. The _id is currently the standard MongoDB generated ObjectId. I also have a unique key constraint against a required 'email' field. This seems like a waste. ...
Esau asked 1/5, 2014 at 0:59

1

Solved

It's possible to create a unique index across tables, basically using a view and a unique index. I have a problem though. Given two (or three) tables. Company - Id - Name Brand - Id - Company...
Revelation asked 6/2, 2014 at 8:38

1

Solved

I've got two fields in my table that if they(tat and dim) are equal I'm discarding them i.e id| tat | dim | visible 1 | 11 | 22 | true 2 | 11 | 22 | false This is considered not to be valid entr...
Printer asked 20/9, 2013 at 11:33

© 2022 - 2024 — McMap. All rights reserved.