Re: Robust ways for checking allowed values in a column

2022-01-25 Thread Rob Sargent
On 1/25/22 09:35, Shaozhong SHI wrote: How about adding null as an alteration. Would this be robust? Regards, David On Tue, 25 Jan 2022 at 14:25, David G. Johnston wrote: On Tue, Jan 25, 2022 at 6:56 AM Shaozhong SHI wrote:  select form from mytable  where form ~

Re: Robust ways for checking allowed values in a column

2022-01-25 Thread Shaozhong SHI
How about adding null as an alteration. Would this be robust? Regards, David On Tue, 25 Jan 2022 at 14:25, David G. Johnston wrote: > On Tue, Jan 25, 2022 at 6:56 AM Shaozhong SHI > wrote: > >> select form from mytable where form ~ >> '^Canal$|^Drain$|^Foreshore$|^inlandRiver$|^Lake$|^lock

Re: Robust ways for checking allowed values in a column

2022-01-25 Thread Ray O'Donnell
On 25/01/2022 13:55, Shaozhong SHI wrote: I tried the following: select form from mytable where form ~ '^Canal$|^Drain$|^Foreshore$|^inlandRiver$|^Lake$|^lockOrFlightOfLocks$|^Marsh$|^Researvoir$|^Sea$|^tidalRiver$|^Transfer$' I used ^ and $ to ensure checking of allowed values. However, '

Re: Robust ways for checking allowed values in a column

2022-01-25 Thread David G. Johnston
On Tue, Jan 25, 2022 at 6:56 AM Shaozhong SHI wrote: > select form from mytable where form ~ > '^Canal$|^Drain$|^Foreshore$|^inlandRiver$|^Lake$|^lockOrFlightOfLocks$|^Marsh$|^Researvoir$|^Sea$|^tidalRiver$|^Transfer$' > You do not need to repeat the boundary metacharacters on each branch. Yo

Re: Robust ways for checking allowed values in a column

2022-01-25 Thread Guillaume Lelarge
Le mar. 25 janv. 2022 à 14:56, Shaozhong SHI a écrit : > I tried the following: > > select form from mytable where form ~ > '^Canal$|^Drain$|^Foreshore$|^inlandRiver$|^Lake$|^lockOrFlightOfLocks$|^Marsh$|^Researvoir$|^Sea$|^tidalRiver$|^Transfer$' > > I used ^ and $ to ensure checking of allowe