How to use between more than 3 times in a single query?

is there any other query to run this query??
SELECT IDSITE,IDVISIT,trim(initcap(page_path)),KEYWORDS,LOCATION_IP,REFERER_NAME,REFERER_URL,VISIT_ACTION_TIME,count(DISTINCT location_ip) from web_stats where idvisit between '441' and '456' and where idsite='1' and visit_action_time between '4-jun-11' and '6-jun-11' group by trim(initcap(page_path)) and order by visitid;
Edited by: 863765 on Jul 7, 2011 4:21 AM

863765 wrote:
is there any other query to run this query??
SELECT IDSITE,IDVISIT,trim(initcap(page_path)),KEYWORDS,LOCATION_IP,REFERER_NAME,REFERER_URL,VISIT_ACTION_TIME,count(DISTINCT location_ip) from web_stats where idvisit between '441' and '456' and where idsite='1' and visit_action_time between '4-jun-11' and '6-jun-11' group by trim(initcap(page_path)) and order by visitid;That query doesn't even have valid syntax. Too many WHERE's and too many AND's and dates being treated as strings, and not the right number of grouping columns...
Something like this is more likely to work.
SELECT IDSITE
      ,IDVISIT
      ,trim(initcap(page_path))
      ,KEYWORDS
      ,LOCATION_IP
      ,REFERER_NAME
      ,REFERER_URL
      ,VISIT_ACTION_TIME
      ,count(DISTINCT location_ip)
from   web_stats
where  idvisit between '441' and '456'
and    idsite='1'
and    visit_action_time between to_date('04-jun-2011','DD-mon-YYYY') and to_date('06-jun-2011','DD-mon-YYYY')
group by IDSITE
        ,IDVISIT
        ,trim(initcap(page_path))
        ,KEYWORDS
        ,LOCATION_IP
        ,REFERER_NAME
        ,REFERER_URL
        ,VISIT_ACTION_TIME
order by visitid;Note: assuming visit_action_time is a DATE datatype, the comparison should be against DATE datatypes also, rather than strings, so you should use TO_DATE to conver those strings to dates. It's also good practice to use 4 digit years rather than 2 digit years, as we had to solve all the 2 digit year millenium bug issues back in the late 90's; we don't want to have to do that again now do we?

Similar Messages

  • How to show three more than one row as single row

    for example there are two tables employee and department.
    emp id dept_id
    101 1
    101 2
    101 3
    Due to different dept id i am getting three rows for same emp id. Is there anwyay i can show one row and all three departments into one line.
    output like this 101 1/2/3
    Please help!
    Thanks

    864470 wrote:
    However, I am not getting any distinct values for that.Are you sying there are multiple records for same emp_id, dept_id combination? If so:
    SQL> with t as (
      2             select 101 emp_id,1  dept_id from dual union all
      3             select 101,2 from dual union all
      4             select 101,2 from dual union all
      5             select 101,3 from dual
      6            )
      7  -- end of on-the-fly data sample
      8  select  emp_id,
      9          rtrim(xmlagg(xmlelement(d,dept_id,'/').extract('//text()') order by dept_id),'/') dept_list
    10    from  t
    11    group by emp_id
    12  /
        EMP_ID DEPT_LIST
           101 1/2/2/3
    SQL> with t as (
      2             select 101 emp_id,1  dept_id from dual union all
      3             select 101,2 from dual union all
      4             select 101,2 from dual union all
      5             select 101,3 from dual
      6            )
      7  -- end of on-the-fly data sample
      8  select  emp_id,
      9          rtrim(xmlagg(xmlelement(d,dept_id,'/').extract('//text()') order by dept_id),'/') dept_list
    10    from  (
    11           select  emp_id,
    12                   dept_id
    13             from  t
    14             group by emp_id,
    15                      dept_id
    16          )
    17    group by emp_id
    18  /
        EMP_ID DEPT_LIST
           101 1/2/3
    SQL> SY.

  • How Do I Share My Database Between More Than One User Account on the Same Mac?

    How Do I Share My Database Between More Than One User Account on the Same Mac?

    How to use multiple iPhone, iPad, or iPod devices with one computer. The only way is for you to have a separate user account to log into on that computer.

  • How do I edit more than 1 photo at a time?

    How do I edit more than 1 photo at a time using the same editing actions.  For example: selecting 50 photos and pushing the fix red-eye button to fix all 50. Specifically I usually enhance, fix red eye and then vinette my pictures then create a slideshow.  With thousands of pictures this is becoming impossible to do 1 at a time....

    http://www.feroxsoft.com/ibe/index.php.en
    -  though I don't know that you can fix redeye like that...

  • HT204411 i am trying to purchase many songs at one time. i have added all songs to wish list , now to purchase it will only let me  do one at a time  please advise how i can purchase more than one at a time

    i am trying to purchase many songs at one time. i have added all songs to wish list , now to purchase it will only let me  do one at a time  please advise how i can purchase more than one at a time

    There used to be a 'buy all' button on the wish list screen but for some reason that has been removed from the current version of iTunes so you will need to buy each item individually. You can try leaving feedback for Apple and maybe it'll be added back in a future update : http://www.apple.com/feedback/itunesapp.html

  • When designing, how do I copy more than one field at a time?

    How do I copy more than one field at a time?

    Hi,
    You can use the Ctrl or Shift modifier keys to select multiple form items. Ctrl+click toggles the selected state of the item. Shift+click selects a range of form items.
    Regards,
    Brian

  • HT204368 How do I connect more than one Bluetooth enabled music device (subwoofer and Jambox) to my iPad at the same time?

    How do I connect more than one Bluetooth enabled music player (subwoofer and Jambox) to my iPad at the same time?

    You could start by posting onto an iPod forum instead of a "Using iPad" forum.  

  • How can I buy more than one item at a time?

    How can I buy more than one item at a time i iPhote fx a book and a calander? It would be nice to place one order and only pay for the shipping once!

    You can't.
    Regards
    TD

  • How do I delete more than 1 email at a time in my inbox - on my iPhone or iPad?

    How do I delete more than 1 email at a time in my inbox - on my iPhone or iPad?
    I've tried "marking" them - but can't move to trash?

    How to Mass Delete Emails from iPhone and iPad Inbox (with video)
    http://suiteminute.com/how-to-mass-delete-emails-from-iphone-and-ipad-inbox/
     Cheers, Tom

  • How do you delete more than one photo at a time on Iphone 3gs camera roll?

    How do you delete more than one photo at a time on the Iphone 3gs camera roll?

    You can't.

  • How do I merge more than one PDF document into one singular pdf using adobe viewer touch on a microsoft surface?

    How do I merge more than one PDF document into one singular pdf using adobe viewer touch on a microsoft surface?

    Or using the Adobe PDF Pack https://www.acrobat.com/

  • How do I highlight more than one thing at a time on a Mac please

    how do I highlight more than one thing at a time on a Mac please

    Do you mean items in Finder?
    To highlight (select) a whole block of items :
    - click the top item you want
    - hold down Shift
    - click the bottom item you want
    The whole range from top to bottom will be highlighted
    To select random items :
    - click the first item
    - hold down the Command key
    - click any more items anywhere in the list
    Just the items you clicked will be highlighted
    This technique works also in apps like iTunes, iPhoto, etc.

  • How do I view more than one image at the same time in CS6?

    How do I view more than one image at the same time in CS6?

    Hi there
    If you go to Window > Arrange you can choose from several view options. Below I have selected Two-Up Horizontal since I have two images, but you can select other options if you have more than one image.

  • HT5525 How can I order more than one picture at a time in iphoto?

    How can I order more than one picture at a time in iphoto?

    It's also wise to crop the photos to the print size you're ordering so you have control over what portion of the image gets printed.  Otherwise, the image will be scaled so the smaller dimension fills the paper cropping off some of the oither dimension.
    OT

  • How do I delete more than 1 slide at a time from the custom slide show in Elements 8

    How do I Delete more than 1 slide at a time from the custom slide show in Elements 8?

    How to Mass Delete Emails from iPhone and iPad Inbox (with video)
    http://suiteminute.com/how-to-mass-delete-emails-from-iphone-and-ipad-inbox/
     Cheers, Tom

Maybe you are looking for

  • Single idoc generation for multiple sales orders

    Hi, Pls let me know how do we generate single idoc for multiple sales orders. Its not collecting idoc. As we know we can generate an idoc for one sales order correspondingly my requirement is to generate single idoc number for multiple sales orders.

  • TS1702 Updates in App Store is not showing the Apps list

    After updating iOS to 6.1 in my iPhone 4s, while tapping 'Updates' in App Store, it is not showing the Apps list, though over the icon it is showing that 11 Apps has got Updates available.

  • Populating a load-status table from SQL*Loader

    Hello, I am using SQL*LDR to load a table and once I'm done with this load I am supposed to populate a status table which will capture the 'SYSDATE', and the total number of rows I loaded in the other table. Can anybody help me? Thanks

  • Iweb not allowing me to go to all of my pages on my wed site

    I have created a site and I cannot move from page to page. It will only allow me to see the Welcome page when I visit. Also the photos on the Photo page were doing the slide show and now it will not. Trina

  • 10g UIX UIExtensions

    This is sort of a followup to a UIX thread: Refer to 'parent' 'uix.current'? The extension I posted there appears to be working, but the compiler always complains that it is 'unable to parse binding' on my UIExtension classes. It's just a warning, an