Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. missmis44

    NUMTOYMINTERVAL - Subtracting 18 years

    I am trying to select from a Query that I created a count of the inmates that were over 17 when they were booked. I am getting the following Oracle Error: DECLARE * ERROR at line 1: ORA-01839: date not valid for month specified ORA-06512: at line 18 SELECT COUNT(BOOK_ID) INTO ADULT_MALE FROM...
  2. missmis44

    ORA-00920: invalid relational operator

    Thanks Mufasa and Barb!!! You two are awesome. Here is my final solution. SELECT J.BOOK_ID, A.FEL_MIS_WT, J.BOOKDATE FROM JMMAIN J, ARMAIN A WHERE (A.BOOK_ID,DECODE(A.FEL_MIS_WT, 'F',1,'W',2,'M',3)||A.ARRE_ID) IN (SELECT A.BOOK_ID, MIN(DECODE(A.FEL_MIS_WT...
  3. missmis44

    ORA-00920: invalid relational operator

    I am now getting the following error: MIN(DECODE(R.FEL_MIS_WT,'F',1,'W',2,'M',3) * ERROR at line 7: ORA-00920: invalid relational operator SELECT J.BOOK_ID, A.FEL_MIS_WT, J.BOOKDATE, A.ARRE_ID FROM JMMAIN J, ARMAIN A WHERE (J.BOOK_ID, DECODE(A.FEL_MIS_WT,'F',1,'W',2,'M',3)...
  4. missmis44

    ORA-00920: invalid relational operator

    More details in thread1177-1136650 I am getting the following error: ORA-00920: invalid relational operator with this script: SELECT J.BOOK_ID, A.FEL_MIS_WT, J.BOOKDATE, A.ARRE_ID FROM JMMAIN J, ARMAIN A WHERE (J.BOOK_ID,DECODE(A.FEL_MIS_WT, 'F',1,'W',2,'M',3)||J.BOOKDATE,A.ARRE_ID)...
  5. missmis44

    Query Filtered by Data

    I added the right paren and am still getting the following error: ORA-00920: invalid relational operator. SELECT J.BOOK_ID, A.FEL_MIS_WT, J.BOOKDATE, A.ARRE_ID FROM JMMAIN J, ARMAIN A WHERE (J.BOOK_ID,DECODE(A.FEL_MIS_WT, 'F',1,'W',2,'M',3)||J.BOOKDATE,A.ARRE_ID) IN (SELECT J.BOOK_ID...
  6. missmis44

    Query Filtered by Data

    I need to get the two scripts to work as one script. I got it to work with your suggestions with just the ARMAIN table but I need to reference both the JMMAIN and ARMAIN TABLES. I am currently working through it. Currently, I can getting an ORA-00920: invalid relational operator Error. This is...
  7. missmis44

    Query Filtered by Data

    I am trying to combine the following two working scripts. I do have to reference the Booking Table because I need to filter the data based on the BOOKDATE. Thanks Again! SELECT BOOK_ID, FEL_MIS_WT, ARRE_ID FROM ARMAIN WHERE (BOOK_ID,DECODE(FEL_MIS_WT, 'F',1,'W',2,'M',3)||ARRE_ID) IN (SELECT...
  8. missmis44

    Query Filtered by Data

    I am trying to create a query to list only one arrest record per booking.There are two tables JMMAIN (Booking) and ARMAIN (Arrest). The ranking are in the following priority order: F,W,M. If both records are the same, such as BookNum 2 that has two Fs and one M, I want it to display ArrestID 5...
  9. missmis44

    POPULATING NULL FIELDS FROM RELATED FIELD W/IN SAME TABLE

    When we book an inmate and fingerprint them they are given one pcn number. Sometimes for instance if we serve a warrant, they are fingerprinted again, and they get another pcn number. they get a pcn number each time they are fingerprinted. Our business rules are, if they have a separate pcn...
  10. missmis44

    POPULATING NULL FIELDS FROM RELATED FIELD W/IN SAME TABLE

    UNFORTUNATELY, THERE CAN BE MULTIPLE PCN NUMBERS FOR EACH ARREST RECORD DO TO POLICE POLICE. DARN BUSINESS RULES GET IN THE WAY. THE ARREST CHARGE TABLE IS CALLED ARCHRG AND THE ARREST TABLE IS ARMAIN. I TYPED IT UP WRONG...SORRY ABOUT THAT. ERIN
  11. missmis44

    POPULATING NULL FIELDS FROM RELATED FIELD W/IN SAME TABLE

    THIS WORKED PERFECTLY. THANKS AND HAVE A GREAT WEEKEND! UPDATE ARCHRG A SET CJI_PCN = (SELECT MAX(B.CJI_PCN) FROM ARCHRG B WHERE A.ARRE_ID = B.ARRE_ID ) WHERE CJI_PCN = ' ';
  12. missmis44

    POPULATING NULL FIELDS FROM RELATED FIELD W/IN SAME TABLE

    The Arrest Table and Arrest_Charge Table are separate. Sorry that I did not clarify that. I will give that a try, thanks!
  13. missmis44

    POPULATING NULL FIELDS FROM RELATED FIELD W/IN SAME TABLE

    FOR AN ARREST RECORD, WE ONLY ENTER THE CJI_PCN FOR THE FIRST RECORD.THIS SCRIPT NEEDS TO POPULATE ALL THE OTHER RECORDS WITH THE SAME ARRE_ID WITH THE CJI_PCN THAT IS POPULATED, IN OTHER WORDS WHERE CJI_PCN IS NULL, POPULATE IT WITH THE CJI_PCN OF THE RECORD THAT HAS THE SAME ARRE_ID. FOR...
  14. missmis44

    CREATE TABLE LOOP of dates

    The script ran but there is not any data in the table: PL/SQL procedure successfully completed. I still need to calculate my two counts How can I do this without formatting the POP_DATE with and without the timestamp: -Count Each Day at 8AM: Where 09/07/2001 08:00:00 falls between BOOKDATE AND...
  15. missmis44

    CREATE TABLE LOOP of dates

    This is what I have so far but I am still getting an error.: DECLARE POP_DATE DATE := TO_DATE('09/07/2001 08:00:00', 'MM/DD/YYYY HH24:MI:SS'); AM_CT NUMBER (10); FULL_CT NUMBER (10); BEGIN WHILE POP_DATE < SYSTIMESTAMP LOOP /*AM_CT SHOULD DISPLAY THE COUNT OF INMATES AT 8AM EACH...
  16. missmis44

    CREATE TABLE LOOP of dates

    For the FULL_CT, I want to return how many people were in custody at any point in the day: FULL_CT = SELECT COUNT(BOOK_ID) FROM CJI_BOOK_RELEASE WHERE TO_DATE(POP_DATE, 'MM/DD/YYYY') BETWEEN BOOKDATE AND RELEASEDATE;) REM I forgot to include the between...
  17. missmis44

    CREATE TABLE LOOP of dates

    I am trying to create a table that lists the date from the first date of a record in the system through the current date, a count at 8:00 AM Each day of how many inmates we have in the jail and a full day count of inmates in the jail. Once this table is created through today. I want to run a...
  18. missmis44

    I am taking a practice test for the

    Is it because the word 'ORDER' is an invalid table name? Is this why I cannot create a table called 'ORDER'?
  19. missmis44

    I am taking a practice test for the

    I am taking a practice test for the Intro to Oracle exam. Why is the answer: Line 1 Evaluate this CREATE TABLE statement, which line of this statement will cause an error? 1. CREATE TABLE order ( 2. id# NUMBER(9) CONSTRAINT PRIMARY KEY, 3. order$ NUMBER(9) CONSTRAINT NOT NULL, 4. date_1 DATE...
  20. missmis44

    Subtract 35 minutes from sysdate

    Thanks guys...that worked perfectly. :-) Erin

Part and Inventory Search

Back
Top