Workaround in mysql for partial Index or filtered Index?
问题 I am using mysql db. I know postgresql and SQL server supports partial Indexing. In my case I want to do something like this: CREATE UNIQUE INDEX myIndex ON myTable (myColumn) where myColumn <> 'myText' I want to create a unique constraint but it should allow duplicates if it is a particular text. I couldn't find a direct way to do this in mysql. But, is there a workaround to achieve it? 回答1: I suppose there is only one way to achieve it. You can add another column to your table, create index