Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: WHERE IN query
On Mon, 26 Apr 1999 tabates_at_my-dejanews.com wrote:
> "Arjan van Bentem" wrote:
> > Timothy wrote
> > > Select * from Table
> > > where ID||Name in (select ID2||Name2 from Table2)
> >
> > Secondly, and by far more important: surely a day comes when someone enters a
> > value for name that starts with a digit. I really think it is bad practice to
> > use such combined keys, unless really needed.
>
> I hadn't anticipated that situation.
> ID Name
> 1 2Timothy
> 12 Timothy
>
> would both match based on my suggestion.
>
> So unless you have controls that prohibit Name from starting with a number,
> I would advise against my initial suggestion.
> Thanks to Arjan for pointing out this potential pitfall.
>
> Timothy
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
>
Or you could simply change
where ID||Name in (select ID2||Name2 from Table2)
to
where ID||'-'||Name in (select ID2||'-'||Name2 from Table2)
Tommy
Email: tomhag_at_rsv.se Received on Wed Apr 28 1999 - 08:32:25 CDT
![]() |
![]() |