3

LastNameとFirstNameを持つPersonテーブルがあります。

次のレコードを検討してください。

FirstName=='Pete'およびLastName=='Aaaa'

次のselectステートメントを実行すると:

select * from Person where FirstName='Pete' and LastName like 'a%' -- 0 record returned
select * from Person where FirstName='Pete' and LastName like 'aa%' -- 1 record returned
select * from Person where FirstName='Pete' and LastName like 'aaa%' -- 0 record returned
select * from Person where FirstName='Pete' and LastName like 'aaaa%' -- 1 record returned

これをSQLFiddleで実行すると、 SQL Fiddleクエリの場合と同様に、選択ごとに1つのレコードが返されます。

誰かアイデアはありますか?

4

1 に答える 1

2

これを試して

select * from Person where FirstName='Pete' and LastName collate Latin1_General_CI_AS like 'a%'
select * from Person where FirstName='Pete' and LastName collate Latin1_General_CI_AS like 'aa%'
select * from Person where FirstName='Pete' and LastName collate Latin1_General_CI_AS like 'aaa%'
select * from Person where FirstName='Pete' and LastName collate Latin1_General_CI_AS like 'aaaa%'
于 2012-11-09T12:25:21.777 に答える