Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Please help with tricky SQL statement....
On Tue, 24 Feb 1998 11:29:17 -0600, sjudkins_at_christyind.com wrote: Hi,
use the INSTR-Function for this task and think about a mean that '5' wouldn't be found in '51'. The best soulution however would be that you normalize your tables:
Table meeting:
MEETNR NUMBER (PK) DATE DATE/TIME TEXT VARCHAR2
Table empoyees
EMPNO NUMBER (PK) NAME VARCHAR2(40) etc..
Table JOINSMEETING
ID NUMBER (PK) MEETNR NUMBER (FK) EMPNO NUMBER (FK)
>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
-- Regards Matthias Gresz :-) GreMa_at_T-online.deReceived on Wed Feb 25 1998 - 00:00:00 CST
![]() |
![]() |