Results 1 to 2 of 2

Thread: reg sql

  1. #1
    Join Date
    Jul 2004
    Posts
    1

    Unanswered: reg sql

    Hello all
    i have a prepared statement like

    select ticketid,name,ticketdate,sol,info from tickets,sol where ticketid=solid and ticketdate between to_date(?) and to_date(?);

    stmt.setstring(1,date1);
    stmt.setstring(2,date2);

    this query works .but now i need to count the number of id's created for each particular day between the two days specified and display it .If i use count it gives total ids created between days and not for each particular day.

    thanks inadvance

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    PHP Code:
    SELECT ticketid
               
    name
               
    ticketdate
               
    sol
               
    info,
               
    count(ticketidOVER (PARTITION BY TO_CHAR(ticketdate,'MMDDYYYY')) ticketids_per_day
      FROM tickets
    sol
     WHERE ticketid 
    solid AND ticketdate BETWEEN date1 AND date2
    Last edited by The_Duck; 07-23-04 at 16:40.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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