SQL help with creating a view

Hi, I am looking to create a view that needs, based on a table.
Table:
Roll, Code, Qual, Date
1 05 KO 112010
1 35 01 112010
1 98 01 132011
etc...
I need only the row (roll) code 05 and ko but this roller should have a line with Code 35 Qual 01 with the same Date. I am able to get all the lines have the right Codes (05 and KO with 35 and 01). I don't know how I can then join it on itself to give me just the line 05/ko where correspond to the date and rollers.

Try this not tested.

In addition, the date of which as column name isn't suggestable. Change it if possible.

create view v1
as
select * from rolltable r
where code=05
and qual='KO'
and exists (select * from rolltable where code= 35 and Qual='01' and roll=r.roll and date=r.date);

Tags: Database

Similar Questions

  • Hello all, I need help with creating a dynamic region in jdeveloper 11.1.2.3 version

    . Hello everyone, I need help with creating a dynamic region in jdeveloper 11.1.2.3 version

    What JDK you are using?

    You are probably using an old version of the JDK, that class while compiled under JDK 1.7.0

    http://java67.blogspot.com/2012/10/how-to-fix-javalangunsupportedclassversionerror-major-minor-version-49-50-51.html

    For example, work with the correct version, and it will be fine...

  • I still need help with a thumbnail view in video files Real Player XP sp 3

    I still need help with thumbnail view in video files Real Player XP sp 3-Help! Help! Help!

    You will need to contact the support of Real Player, since the problem occurred with their program.

  • Need help with creating a database connection

    Installed SQL Developer with JDK 1.6. When you try to create a database connection, I have encountered this problem.

    I/O Exception: The network adapter could not establish a connection

    Do I need to download the Oracle database?

    You can also look in installation of Oracle XE.

    It carries a much lighter than the standard (or Enterprise) edition footprint and is free (with some restrictions, that you can read).

    http://www.Oracle.com/technology/software/products/database/XE/htdocs/102xewinsoft.html

  • problems with creating a view

    Hello experts,

    I am having trouble with my opinion. I need to create a view of 3 tables, but the view is empty. Its settlement data not at all
    CREATE OR REPLACE FORCE VIEW inv_serial_tracking_v
    (
      PRODUCT_ID            ,
      GAME                  ,
      SERIES                ,
      SERIAL_NUMBER         ,
      PORTION_NUMBER        ,
      BEGIN_PIECE           ,
      END_PIECE             ,
      LOCATION_TYPE         ,
      LOCATION_ID           ,
      retailer_name         ,
      INV_STATUS_ID         ,
      inv_status_name       ,
      REF_DOC_TYPE          ,
      REF_DOC_NUMBER        ,
      REF_DOC_LINE          ,
      LOAD_NUMBER           ,
      CARTON_NUMBER         ,
      STATUS_DATE_MODIFIED  ,
      PCT_VALIDATED         ,
      LAST_DATE_MODIFIED    ,
      USER_MODIFIED         ,
      CDC                   ,
      LT_PAID_CNT           ,
      MT_PAID_CNT           ,
      FST_PAID_TKT          ,
      LST_PAID_TKT          ,
      SOLD_OUT              
    )
    AS
       SELECT   a.product_id,
                b.name game,
                a.series,
                a.serial_number,
                a.portion_number,
                a.begin_piece,
                a.end_piece,
                a.location_type,
                a.location_id ,
                a.inv_status_id,
                j.status inv_status_name,
                a.REF_DOC_TYPE          ,
                a.REF_DOC_NUMBER        ,
                a.REF_DOC_LINE          ,
                a.LOAD_NUMBER           ,
                a.CARTON_NUMBER         ,
                a.STATUS_DATE_MODIFIED  ,
                a.PCT_VALIDATED         ,
                a.LAST_DATE_MODIFIED    ,
                a.USER_MODIFIED         ,
                a.CDC                   ,
                a.LT_PAID_CNT           ,
                a.MT_PAID_CNT           ,
                a.FST_PAID_TKT          ,
                a.LST_PAID_TKT          ,
                a.SOLD_OUT 
                
    --            f_get_cdc_date (a.cdc) cdc_date,
    --            f_get_week_num (TO_NUMBER (a.cdc)) week_num,
    --            TO_DATE (
    --               SUBSTR (a.last_date_modified, 1, INSTR (a.last_date_modified,
    --                                                       '.',
    --                                                       1,
    --                                                       3)
    --                                                - 1),
    --               'YYYY-MM-DD-HH24.MI.SS'
    --            )
    --               last_modified_date,
    
         FROM   inv_serial_tracking a,
                games b,
                inventory_status j
        WHERE       a.product_id = b.id
                AND a.inv_status_id = j.id;

    Hello

    The base table/s are? You have used FORCE, which means that the display will be created regardless of whether or not the base tables exist.

    Kind regards.

    Published by: Spongebob on April 28, 2010 15:10

  • Help on creating the view to the oracle10g@redhat4 platform

    Hello

    I tried to create a view for a table that is specified at the client level Oracle10g that I previously installed on a platform of linux redhat4.

    If anyone can guide me how to do this.

    It is to show some nsuffisante privillage


    So how do I solve this problem

    More details needed...

    For the syntax.

    Create View view-name as Select...

    EG-
    CREATE VIEW view_emp
    AS
    SELECT EmpID FROM emp;

  • Help to create the view - error: ORA-00955: name is already used by an existing object

    Hello

    I am trying to create the following view but sqlplus displays a message and point of view has not been created. I use 11g Express.

    SQL > create view (client, f_pedido, total) orders as

    2     (

    3 select usr, date, sum (rising) as important

    4 of

    5             (

    6 select lineas_any.usuario as usr, lineas_any.fecha_pedido as date, lineas_any.cantidad * as rising referencia.precio

    7 of lineas_any

    inner join 8

    referencia 9

    10 on lineas_any.referencia = referencia.codbarras

    11             )

    Group 12 by usr, date

    13)

    14 order by date asc, usr;

    of lineas_any

    *

    ERROR on line 7:

    ORA-00955: name is already used by an existing object

    There are also descriptions of the two tables involved:

    SQL > describe lineas_any

    Name                                          Null?    Type

    ------------------------------------------------------ -----------------

    USER NOT NULL VARCHAR2 (60)

    FECHA_PEDIDO NOT NULL DATE

    REFERENCIA NOT NULL VARCHAR2 (15)

    AMOUNT NUMBER (2)

    SQL > describe referencia

    Name                                          Null?    Type

    ------------------------------------------------------ -----------------

    CODBARRAS NOT NULL VARCHAR2 (15)

    PRODUCT NOT NULL VARCHAR2 (50)

    FORMATO NOT NULL VARCHAR2 (20)

    SILTING NOT NULL VARCHAR2 (15)

    PRECIO NOT NULL NUMBER (7.2)

    STOCK NUMBER (5) NOT NULL

    MIN_STOCK NOT NULL NUMBER (5)

    MAX_STOCK NOT NULL NUMBER (5)

    Please, could someone help me in this matter?

    Thanks in advance.

    Kind regards

    It means that it is already an object named peridos. Question:

    Select object_type from user_objects where object_name = 'PERIDOS;

    to find out what type of object it is. Any chance you try to change the existing definition of peridos view? If so, use

    CREATE or REPLACE view orders (customer, f_pedido, total) as...

    SY.

  • Need help with creating user hr

    Question

    To perform the requested operation, an error has occurred:

    ORA-01045: user HR has no privilege CREATE SESSION; connection refused

    01045 00000 - "user %s has no privilege CREATE SESSION; connection refused '.

    * Cause: A connection was attempted to a user name that does not

    create session privilege.

    * Action: Grant the CREATE SESSION from the user privilege.

    Code provider 1045

    SELECT * FROM DBA_SYS_PRIVS WHERE DEALER = "HR";
    No output

    SELECT * FROM DBA_ROLE_PRIVS WHERE DEALER = "HR";

    No output

    Finally did this:

    ALTER USER DEFAULT ROLE CONNECT HR;
    Again gives error

    ALTER USER DEFAULT ROLE HR CONNECT

    Error report-

    SQL error: ORA-01955: DEFAULT ROLE "CONNECT" not granted to the user

    01955 00000 - 'ROLE '%s' not granted to the user by DEFAULT'

    * Cause: Modified user does not have the specified role granted

    directly to the user.  Note that the secondary roles can be used in the

    default role clause.

    * Action: Grant the role to the user.

    In fact, it's delicate. The HR schema is installed for Oracle 12 c installation of database. However, it is locked or hidden. You must unblock with instructions as below.

    Select * from v$ PDB;

    Select name from v$ active_services where con_id = '3';

    change the container set session = pdborcl;

    ALTER database connectable to open;

    ALTER user identified by HR HR account unlock;

    Tutorial is here:

    https://www.YouTube.com/watch?v=iVo6Xnzeteg

  • Help with renovation Horizon View client for Mac

    I'm packaging the client VMware View Horizon for our Mac desktops and laptops (we have about 150). Normally, it is a very simple and very easy process with this client because it is just a soft. We use Apple PackageMaker to repackage the Horizon of VMware View Client.appand add the plist for the test user for the deployment of future users profiles. We used some com.vmware.view.plist in the past to ensure that our connection to the server is prefilled and force PCoIP. It has worked great for us with all < 2.3 versions.

    From 2.3 and 3.0 now, I have not been able to repackage the application correctly. I have download the .dmg to VMware and copy the .app in it in / applications; This is exactly how a user would install it on their system. I run the Client discovers once and connect to our login server using the settings I want to paste when you deploy this application to our machines. Then using PackageMaker, I point the first part of the package that will be created for Applications/Vmware view Horizon Client.app as usual (including the roots). It's normal. I choose com.vmware.view.plist file, and I'm using a plist Editor, delete the entry for my test user name and office that I'm connected to. In PackageMaker, the destination of this .plist file is in the default profile for the mac - so whenever a new user connects to the mac, they will receive the file .plist with the parameters we want. Sounds good. The package is built successfully. I deploy it on a machine to test successfully.

    When I connect on a test system and run the client from the view, I can connect properly. If I try to use the menu connection/printing enabled, all hell breaks loose and I get a series of errors;

    Invalid file in the package.

    The file is not valid:

    / Applications/VMware Horizon view Client.app/Contents/Library/thnuclnt/thnusetup.sh.

    Please download the official product.

    If I try to start services remotely USB, I get a similar error once it issues a warning that I will be asked to enter the credentials of the admin;

    Invalid file in the package.

    The file is not valid:

    / Applications/VMware Horizon view Client.app/Contents/Library/InitUsbServices.tool.

    Please download the official product.

    ?? If I run the app from the .dmg on this same machine, I have no problem. Any ideas?

    OK, I just had to put the question so that I could think clearly through it.

    There are some extended attributes on these shell scripts that PackageMaker removes when it reconditions the app. I conditioned as a .dmg, and copy the app via the postinstall script in the pkg... works very well after that.

  • Need help with creating Swatch palette library book

    I am an employee in a company that produces uniforms and custom clothing.  Our art Department converts and creates logos using embroidery threads and printing inks business tones.

    A major challenge that we are facing on a daily basis is to select the right thread and ink spot of the work provided by the Subscriber.

    Our embroidery in-house manufacturing operation has 300 + thread colors and our printing division has a standard range of 60 +.  Our staff has manually from each wire color in our library of PMS graphics and created an excel spreadsheet that maps all the information of the son that we carry.  From this information, we have created custom color palettes.  Pallets work very well in the creation of art from scratch, BUT they can't help us identify possible closest matching wire color of work provided by the Subscriber using the eyedropper tool.

    I NEED A BOOK OF CUSTOM COLOR THAT WOULD ALLOW THE TOOL PIPETTE THE COLOUR CLOSEST TO WIRE IN OUR LIBRARY, THE SAME FEATURE THAT IS USED TO FIND A MATCH OF PANTONE PMS.

    I have done extensive research on the creation of a custom color book and invested dozens of hours trying to modify/create one in FRANCE following the material I've seen online of programming language.  This task proved beyond my capabilities and I have received no response and I sent to each poster who has never responded to this topic on these forums private messages.

    Anyone here have experience in the creation of a book of custom colors for the purpose of the correspondence of digital art in the library?

    I may be a solution to the problem even if I tried it with only a limited number of colors. The downside is the fact that you need to create a swatch of your color library. On the side: once the graph is saved, you can reference it at any time and apply it. It seems worth your time to test this method.

    Create the color chart:

    1. open a new file, 12 "x 12" 72 dpi RGB 8 bits

    2. choose Image > Mode > indexed Color custom Palette

    3. click in the first box in the grid. The color picker opens.

    4, adjust the RGB values of the color first in your personal library of color

    5. click on the next box and repeat the procedure to add color chips

    6. when the graph to complete (or as big a levy that you choose for the test) choose Save, name the file and save it to your desktop. Close the file,

    Locate the closest color:

    1. open the client file and use the pipette to a choose a color in it.

    2. choose Image > color > Color Table. Your personal color table will be redisplayed.

    3. click on the eyedropper in the table

    4. click on the foreground color that you put in the foreground color patch

    5. the box in the graph which is closest to this color will be chosen.

    6. option click on return to the table to its State unmarked

    close

  • Need help with creating a menu transition

    Hello I made a lot of progress on a DVD project, I am working on creating a query menu system until now, I've run into a brick wall last night and it's driving me nuts so I hope someone can help me with a few brilliant Creator here, I'll try to keep this short and understandable because it can be a challenge to transmit Please note other things are happinging with this project , but I'll try to include only relevant information to keep this pointer:

    Basically I have a background image static with a picture on it for a DVD menu I have it animate in and now I'm facilitating a transition from the "main Menu" and "Menu scenes".

    I try to have the scan everywhere (simple) from right to left, picture how the Menu title above and not behind the image is supposed to be 'deleted' as the image sweeps and the menu will then continue to clear off the screen once the image stops; during which the title of "Scènes Menu" sweep on in the reverse fassion (opposite to the clear operation) on the same horizontal plane on the right to the left.

    I first tried to use a solid and the image of the parents and then animate offshore, but my background is not a solid color, there textures so I need to keep the same consistency with the background.

    I was able to create a new comp and use the null with a solid object to allow mobile coverage on top, but I still have a solid color, how can I create a cover 'mousemat' mobile that will be selectrively cover your layers by displaying and hiding what I want.

    For this I'm trying to do a wipe in front of a screen to clear the title of annother and producing a new title using the menus time, same texture background.

    Thank you for the help I think that it is easy and I can be looking too much into it and overlooking the obvious but happens if I appreciate the clearity.

    Well they are the menus from en not just text in Ae but I see what your saying what I could do is put a new Basemap layer on and use a couple of masks that changed shape with the directional blur and added a wipe degraded; It seems to work pretty well for me.  Thank you very much for the help.

  • Need help with creating table that inserts the lines according to the amount of data

    Hello

    I try to create a table for supervisors to enter their subordinates of information and inserts lines for supervisors with several of his subordinates.  This form is not be connected to a data source, the supervisors will be simply fill out the form and print.  I want it sort of look like this:

    Name Position # Ranking Hours

    I really appreciate any help.  Thank you!

    Hi Laura,

    It's very strange. I downloaded a new version on the site and it works perfectly. The script is in the right place.

    I can sugggest you right click on the download link and select "save a copy as" the alternative menu. This should save the form locally and from there, you should be able to open it in Acrobat.

    If you are a Mac, make sure that the form opens in preview from Apple.

    Also make sure that Javascript is enabled in Acrobat (in the preferences window).

    Niall

  • Help with creating this effect of first elements 9

    I am trying to create an effect similar to the YouTube below starting at 55 seconds.  More light in the Middle, shaded, and the colors are a bit dull.  Can you suggest how you would re-create this effect with premiere elements 9 and what effects to use?  Thanks for the help.

    Here's the clip: http://www.youtube.com/watch?v=mrqg1oqfg_Y

    This is mainly my shot "Dreamscape" effect of the book - except that I show you how to blend the edges rather than darken them. But I show you step by step in the book.

    Basically, you create a track matte, using a graph of size screen is white in the middle and gradiating to the darker or black on the sides. When you apply the matte effect follow your clip and then use this graphic on a track above to set the matte effect to follow, you will get exactly what you are looking for. Just as in the book! (I even discuss the use of caches in the chapter sample displayed on this page.)

    http://Muvipix.com/CoolTricks

    It's a little big investment if you are looking for instructions for the creation of special effects!

  • Help with creating Windows DVD longer is set to 16:9 but burn with 4:3

    Hello, I have a problem with the windows dvd marker. I burned two DVD until now and they all have two aspect ratio of 4:3 i have changed to 16:9 in the menu options, but each time its only 4:3. I tried to look on google how to fix this and I discovered that passing the AVI to WMV file type will be slove the problem. so my question is would this cause really work that I don't have much time to waste because the creation of dvd takes a long time to burn the dvd and I don't want to end up with 4:3, this time? so, if some can help me that would be very nice.

    Hi Akshaypatel,

    I suggest you follow the advice given by Mouneshwar R from the link below.

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-pictures/problems-burning-a-DVD/08ed2466-d74c-4719-9fdb-54dcc8607e80

  • Need help with creating a new site-problem file Spry

    I can't create a new DreamWeaver CS5 site - I get a warning message that the current Spry folder is not inside the site and select a valid file in the local directory. I tried creating a folder nothing is, so is unable to create the site. Help is appreciated.

    An option if you're a Mac: your hard disk named?

    http://forums.Adobe.com/thread/654548

    Also try:

    http://forums.Adobe.com/thread/672446

Maybe you are looking for