www.webdeveloper.com
Results 1 to 3 of 3

Thread: I suck at Oracle

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    USA
    Posts
    352

    Question I suck at Oracle

    So, I have this SQL query:

    Code:
    SELECT SDATE, FNAME, LNAME, DEPARTMENT, INITIALDATE, EMPTYPE, SET1, SET4, SET4OTHER, SET32, SET33 FROM KUHR.exittest WHERE SDATE BETWEEN TO_DATE('" + date_start + "') AND TO_DATE('" + date_end + "') AND DEPARTMENT LIKE '%- " + arsp_num + "% -%' AND SET33 NOT LIKE 'Not Answered'
    It works.

    If I do this instead, it does not:

    Code:
    SELECT COUNT(SDATE), SDATE, FNAME, LNAME, DEPARTMENT, INITIALDATE, EMPTYPE, SET1, SET4, SET4OTHER, SET32, SET33 FROM KUHR.exittest WHERE SDATE BETWEEN TO_DATE('" + date_start + "') AND TO_DATE('" + date_end + "') AND DEPARTMENT LIKE '%- " + arsp_num + "% -%' AND SET33 NOT LIKE 'Not Answered'
    It's probably something simple I'm doing, but I just can't figure it out .

  2. #2
    Join Date
    Jan 2009
    Posts
    14
    I think that you need a GROUP BY and that it will need to include all the columns you selected.

  3. #3
    Join Date
    Jan 2005
    Location
    USA
    Posts
    352
    Quote Originally Posted by b4web View Post
    I think that you need a GROUP BY and that it will need to include all the columns you selected.
    OMG that worked!

    Thank you so much. I was starting to get really pissed off about all this.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles