Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Please help with tricky SQL statement....
select * from appt where userid like '%USERID%'. You will not be able to use an index on the query.
You should consider normalizing the table if possible. That will make queries easier.
sjudkins_at_christyind.com wrote:
>
> I am trying to build a SELECT statement that will select
> records from an "appointment" table. The appointment table
> looks like this:
>
> DATE DATE/TIME
> TEXT VARCHAR2
> APPTIDS VARCHAR2
>
> APPTIDS contains a comma-seperated list of the user IDs
> that is involved in the meeting. Example: '1,5,6'. I need a
> SELECT statement that will return only those rows that
> contain the ID of the current user (in the APPTIDS field)
> but, it can also contain the ID of other users).
>
> I need something like:
>
> "SELECT * FROM APPT WHERE #USERID# IN (IDS)"
>
> This returns rows that ONLY have the USERID in the APPTIDS
> field...instead of ones that contain the USERID AND other
> USERID's.
>
> Thanks for any help!
> Shayne
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
Received on Tue Feb 24 1998 - 00:00:00 CST
![]() |
![]() |