Capturing only the first vendor code (not all) associated with user

Hi All
I have several tables that helps me try to capture the unique number of vendors that are active from the users table as shown below in the SQL script. However, ther is an exception where users may be associated with multiple vendors. I feel that my script captures all associated vendor codes associated with my users. Is there a way of capturing only the first vendor code associated with the user. Thanks for your help.
Gautam
SQL SCRIPT:
select count(distinct(d.vendor_id))
from SSPE.PG_FORM_SUBMIT a, SSPE.SP_USER_AUX b, sspe.pg_supplier_vendor d
where a.SOURCENAME = 'wvInventoryForecast' and
a.PROFILEID = b.ID and
b.SUPPLIER_ID = d.supplier_id and
a.CLOCKTIME between to_date('15-Mar-06','DD-MON-YY') and to_date('04-Apr-06','DD-MON-YY')

you need to have a common criteria to determine which vendor should be selected for an user, if it is by lowest vendor code or if it is the first entered vendor in which case you should have a date (or someother) column to identify which vendor was first associated with the user. In either case you could use the analytic function row_number() to accomplish what you want to do. here is an example
select * from (
select user_id, row_number() over (partition by user_id order by vendor_cd) rn, vendor_cd
from user_table, vendor_table
where <condition>)
where rn=1;
refer online docs for more details on this function (link provided in my earlier post)

Similar Messages

  • Why does only the first page of seach results show, with further pages graying out?

    In a search, I may get >1,000,000,000 hits, but only the first page is readable. "Next" gives me a grayed out screen and FF freezes. Any of the offered searches at the bottom of that first screen will do the same thing. Repeated hitting "back" will clear it.
    This has been true, through all the upgrades, including a backgrade to 3.6 (?) for 64-bit. This makes FF useless as a search platform, though it is my preference, even over Chrome, if it would work.
    Windows 7 Ultimate, 64-bit, 8GB Ram
    High speed to house, wireless lan in house

    That does seem rather useless.
    Use Automator - it has a "PDF to Images" action that will do exactly what you need. Drop your document into the workflow, drop the "PDF to Images" action in right after that, set any options that you need (like where to save) and then click "run"
    Barring that, I've found that sometimes Adobe Reader will sometimes work well for documents that Preview can't print, and I've found some documents that Adobe Reader chokes on but Preview handles flawlessly.

  • On iCloud pages how can you put a header on only the first page and not the second page?

    I'm trying the do a visual report and every time I put a header on the first page it goes to the next page and if I try to delete it on the second page it deletes on the first page too.

    bump

  • How to return only the first string

    Hi Guys,
    I have a mapping where I am creating a filename from data in within my data file, I am using one of my variables i.e. Account
    The data looks like this
    Account:
    123
    123
    123
    456
    456
    456
    789
    789
    789
    What I want is to is return only the first row u201C123" and concatenate it with a constant to make up the filename.
    Any help will be appreciated.
    Kind Regards,
    CJ Bester

    very simple
    use copy value standard function like below.
    Account------->copyvalue(0)----------->
                                                                      CONCAT------------->TARGET
                                         Constant------->
    Regards,
    Raj

  • HT203175 My Ipod does not sinc with all of my Itunes library, only the first few albums. I recently changed my operating system to XP from Vista, which was a pain, and due to my fault had to reinstate most of my albums and all of the playlists.

    Ipod does not sinc with all of my Itunes library, only the first few albums. I recently changed my operating system to XP from Vista, which was a pain, and due to my fault had to reinstate most of my albums and all of the playlists. How do I get my Ipod to sinc fully when I access Itunes?

    Recover media from iPod
    See this post from forum regular Zevoneer for options on moving your iPod data back to your computer.
    tt2

  • Downloads do not appear all (only the first two) in the download statusbar (could be a ff19 or downloadhelper or unmht problem)

    downloads do not appear all (only the first two) in the download statusbar (could be a ff19 or downloadhelper or unmht problem) and none in the download window
    used ff19
    with
    Download Statusbar v0.9.10 by Devon Jensen
    UnMHT v6.2.0 by http://www.unmht.org
    DownloadHelper v4.9.14
    had to revert to ff18.0.2

    Make sure that you do not run Firefox in (permanent) Private Browsing mode.
    *https://support.mozilla.org/kb/Private+Browsing
    *Tools > Options > Privacy: Use custom settings for history
    *Deselect: [ ] "Always use private browsing mode"
    Did you try to disable other extensions?
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Only the first page is printed reduced as setup. All pages afterward are full size with information cut off. Recent problem. Can print from Safari just fine. How can I get all pages to be reduced size?

    Question
    Printing internet pages
    Reduced print size
    Only the first page is reduced and printed as desired
    All pages after the first page are full size with information cut off
    Recent problem never seen before
    Can print from Safari and other software just fine
    How can I get all pages to be reduced size?

    One suggestion worked from the Firefox prints incorrectly link mentioned above by mha007. I'm thrilled since this has been annoying me for weeks. Thanks mha007!
    Reset all Firefox printer settings
    # Open your profile folder:
    # On the menu bar, click on the Help menu and select Troubleshooting Information. The Troubleshooting Information tab will open.
    # Under the Application Basics section, click on Show in Finder. A window with your profile folder will open.
    # Note: If you are unable to open or use Firefox, follow the instructions in Finding your profile without opening Firefox.
    # On the menu bar, click on the Firefox menu and select Quit Firefox.
    # In your profile folder, copy the prefs.js file to another folder to make a backup of it.
    # Open the original prefs.js file in a text editor (such as TextEdit).
    # Remove all lines in prefs.js that start with print. and save the file.
    # If something goes wrong when you open Firefox, close it again and overwrite prefs.js with the backup you made.

  • HT3669 My Epson Perfection 1200 scanner functions as a flatbed scanner but when I try to scan transparencies the control panels change in  Image Capture but the scanner bar will not complete the overview scan  & cannot travel beyond the first 2/3 centimet

    Epson Perfection 1200 scanner continues to function as a flatbed scanner but when I try to scan transparencies/film negs the control panels change in  Image Capture but the scanner bar will not complete the overview scan  & cannot travel beyond the first 2/3 centimeters. All the communications seem to recognise the scanner and the mode for the intended scan but the necessary overview scan is not completed, nothing comes up on the Image Capture scan window. If I unplug the film adaptor I can get a document scan. When I plug in the adaptor again the Image Capture details change which allows me to select the type of scan required but when the scanner attempts an overview scan it is unable to complete it.
    I have had the scanner from new (12 Years) and have previously scanned slides and film with the adaptor but maybe this was before I upgraded my computer (imac 27").
    Do I have to buy a new scanner?  It seems so close to working correctly. 
    I have downloaded the Epson recommended driver (5.4) and have Epson Perfection 1200 6.6 Universal showing in the Applications List.
    Any thoughts or observations would be much appreciated before I go out and spend money an new hardware.
    Thanks

    I have same issue - have you solved this yet?

  • Only the first page for a particular site prints. All other sites are fine.

    I'm running Firefox 10.0.2 on Windows 7 SP1 and when I try to print the web page of the affected URL ( http://windows.microsoft.com/en-US/windows-vista/Connect-to-another-computer-using-Remote-Desktop-Connection ), only the first page is printed. It prints fine in IE 9. I tried printing in safe mode and it still only prints the first page. I only tried printing it once, after that I used print preview alone. I used print preview on a dozen other sites and it works fine. By the way, on the web page I'm trying to print you must "Show All" at the bottom to expand all of the text. It's just this one web page. Can someone else with a similar setup try print preview on this page for me? I just want to know. I printed it using IE. Interestingly, if you scale the print preview down enough, all of the text shows up. Thanks...

    Well, I've made a little progress. I saved the web page source locally and then added the following HTML snippet to the <head> section:
    <style type="text/css">
    div
    page-break-before:always;
    </style>
    When I display this, the "Show all" does not work, but the page text is still long enough to do "Print Preview" and expect more than one page. The result is a blank first page (expected) and then ALL of the page text is printed on the next two pages.
    But I think you are correct "the-edmeister" in saying that Firefox may have a problem when the DIV tag spans more than one page. The reason is that the third page only contains the footer, so I can't say for sure if the whole DIV block was printed. But at least the footer did show up this time.
    If I can get the "Show all" block to expand then maybe that question will be answered. Any thoughts?

  • How do you download all chapters of a video at once?  I purchased a yoga video with multiple chapters and only the first one loaded.  It says I can't download another chapter for 90 days.

    I purchased a yoga video with multiple chapters and only the first one loaded.  It says I can't download another chapter for 90 days.  How do I get all chapters to download?

    Once a device or computer is associated with your Apple ID, you cannot associate that device or computer with another Apple ID for 90 days.
    http://support.apple.com/kb/ht4627

  • When downloading a file, only the first word of the attached file is included in the 'file name' field, not the entire file name, as it used to.

    Regardless of filetype, only the first word of the file is filled into the "Enter name of file to save to..." dialog box. I'm set up to 'save file' in the FF Options > Applications tab for the basic MS and Adobe files. To successfully use/find the downloaded file, I type in the remainder of the file name. Have I overlooked an additional setting? Running FF 18.0 on a Win7 PC.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    A possible cause is that the server sends a wrong response header.
    The server may not comply to RFC 5987 and sends a wrong Content-Disposition:attachment; filename header.
    * https://developer.mozilla.org/en/Firefox_8_for_developers#Network

  • Only the "first section" of CC notes is shown on each slide.

    Hello,
       I have a lot of TTS and CC notes in my presentation.  Although, the box of every "CC note" section is clicked, the CC notes don't proceed beyond the first section.   I have looked at the CC timeline, and the second second should begin at 13 seconds, the third at 19 seconds, and so forth.  During playback, the only the first section is shown for the entire slide.  Any ideas as to what could be wrong? 
    Thanks for any help!
    Ryan

    OK.  Then something isn't quite making sense for me here.
    I just performed a quick test readin of the first line of CC text showing in your screenshot and it came out at 30 seconds.  So I cannot see how the TTS text voice (which is usually slower than mine) would come out at only 14 seconds or so.  It would have to sound like a chipmunk to fit that amount of text in the time frame you say it is using.
    My guess is that the CC text is not appearing perhaps because you have far too much text in each line.
    Try breaking up your text in so smaller chunks.  For example, here's a screenshot of the module I'm currently working in.  I always set my CC text up so that no more than one line is visible at a time.
    I have the CC options in the skin set for the CC section to be 3 lines high and the text is as shown below:

  • My fire fox download helper not detected current video on you tube. It's always shows only the first video which i was downloaded.pls help

    My fire fox download helper not detected current video on you tube. It's always shows only the first video which i was downloaded.pls help

    You need to refresh the page (F5) to update the items in the download menu. Apparently YouTube refreshes the page in such a way that the extension doesn't gets notified, so you need to refresh the page manually if you want to download a media file from this page.

  • Yesterday i downloaded a new album through iTunes. The first track has not copied successfully. This has never happened to me before. How can i retrieve this track. All the other tracks on the album are fine. Peter

    I downloaded an album from itunes but track 1 has not downloaded apart from the first few seconds. All other tracks are fine. How do i get track 1 back?

    re download it through the purchase section of Itunes Store
    Select Purchased from the quick links section. Navigate to the music and click the cloud icon to download

  • Don't know if this went through the first time. Cannon printer would not print black. bought a new Epson-800. Same problem. Can it be something in my Mac causing the problem. It's only the black that is not working.

    Don't know if this went through the first time. Cannon printer would not print black. bought a new Epson-800. Same problem. Can it be something in my Mac causing the problem. It's only the black that is not working.

    Bill ...
    Believe it or not, might be a font issue > Computer won't print black text in...: Apple Support Communities

Maybe you are looking for

  • Deletion is taking long time using forall

    Hi,        i am  inserting and deleting the rows using forall. insert taking less time to inset the rows but while coming to deletion it is taking more than 5 days long time to delete 18.5 million rows in a table using forall. the main table having 7

  • Can't get multiple audio layers on a page to play.

    One of my clients has an online course in which each weekly lesson is presented on one web page. A typical lesson includes three MP3 audio files for playback only (no download). The site is built in WordPress, and is using the MediaElement.js HTML5 a

  • FCE4 and iDVD Anamorphic Ken Burns

    I created a 60min movie in iMovie8 using three media: 1) NTSC Anamorphic DV from a Panasonic PV-GS80, 2) JPEG 2816x2112 stills from a Panasonic DMC-FX3, and 3) 848x480 motion JPEG video from the DMC-FX3. An iMovie 8 project in 16:9 aspect was burned

  • Query to find out sum by using decode or case

    Hi, I have data like below and required an output as given below, could you please help me to get the same by using decode / case .....Thanks for your help INSNAME INSID STATUS AAA 1000 Scheduled AAA 1000 Processing BBB 1001 Inspector BBB 1001 Schedu

  • Can't find the fullscreen option for acrobat 9 pro

    In the technotes it's mentioned that an embedded movie (.mov, .mp4) in acrobat 9 pro can be played in fullscreen. I can't find the option.