How to achieve Assign Unique Value

Hi,
I have a task where I need to assign a new value depending If a Group number falls in particular M area.
For an example : In Database I have:
SELECT DISTINCT 
M,[GroupNumber]
FROM    [COM_Util].[dbo].[Milliman_Max]
WHERE MM=608
ORDER BY  [GroupNumber]
WHAT I NEED is 
Please Kindly help me.

Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. You are not even
close! Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
This is minimal polite behavior on SQL forums. Why did you draw colored pictures instead? That is how a child explains things. If we want to use the data in your pictures, we have to copy it by hand! Why do you think that “m” is a clear, precise name
for a data element in an RDBMS? The postfix “_max” is an attribute property and therefore cannot be part of a table name. 
>> I have a task where I need to assign a new value depending If a Group number falls in particular M area. <<
What is an “m” and what is an “m_area”? Where is a clear spec? Did you notice that your silly pictures have duplicate rows, so they are not even tables?
Why don't read the forum Netiquette, talk to a SQl programmer in your shop and try again? Based on nothing you told us, I will guess that a CREATE SEQUENCE might help. 
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL

Similar Messages

  • How to have a unique value for each record??

    could any 1 help me out in this...
    I want to have a column name 'Order No' which should be unique.
    How to generate a unique value for each record.??

    could any 1 help me out in this...
    I want to have a column name 'Order No' which should be unique.
    How to generate a unique value for each record.?? If you are using SQL PLUS to create the table try something like
    this:
    CREATE TABLE ORDER_TEST (
    ORD_NO NUMBER (8) NOT NULL PRIMARY KEY,
    ORDERDATE DATE,
    CUSTID NUMBER (8) NOT NULL,
    SHIPDATE DATE,
    TOTAL NUMBER (8,2) CONSTRAINT TOTAL_ZERO CHECK
    (TOTAL >= 0),
    CONSTRAINT ORD_FOREIGN_KEY FOREIGN KEY (CUSTID) REFERENCES
    CUSTOMER (CUSTID),
    CONSTRAINT ORD_UNIQUE UNIQUE (ORD_NO)
    -- or a simpler table example
    DROP TABLE ORDER_TEST;
    CREATE TABLE ORDER_TEST (
    ORD_NO NUMBER (8),
    ORDERDATE DATE,
    CUSTID NUMBER (8) NOT NULL,
    SHIPDATE DATE,
    TOTAL NUMBER (8,2) CONSTRAINT TOTAL_ZERO CHECK
    (TOTAL >= 0),
    CONSTRAINT ORD_UNIQUE UNIQUE (ORD_NO)
    note: ORD_NO can also be a primary key
    If you are doing the INSERT during runtime from a form first
    create a sequence in SQL PLUS to handle the ORD_NO value:
    Create SEQUENCE ORDERNO_UNIQUEVAL_sqnc
    START WITH 000001
    NOMAXVALUE
    NOCACHE;
    and reference it as the ORD_NO parameter in your INSERT
    statement:
    ORDERNO_UNIQUEVAL_sqnc.NEXTVAL
    note: to maintain data integrity you must use the sequence
    everytime you insert a new order to table. To start a new
    sequence drop the sequence and re-create it with whatever "START
    WITH" value you want.
    Hope this helps
    Kevin

  • How do you assign multiple values to a single element in an array?

    I'm probably not wording the question right.
    I have an array, let's call it M[], and for each element in the array (we'll say M[1]), I need assign three integers: row, col and value.
    I need to set it up so I can do something like this:
    A.row = M[i].col;
    A[i].col = M[i].row;
    A[i].value = M[i].value;
    The algorithm isn't what I need help with, it's assigning .col, .row and .value to an index of an array.
    Please help if you can.

    You are right. You did not word your question perfectly, but I still think I get what you want.
    First of all: A single element in an array always has exactly one value. No more, no less.
    But that's not a problem. The element in an array is either of a primitive type (boolean, byte, char, short, int, long, float, double) or it's a reference (to a Object, String, MyClass, ...).
    You can simply write a class that holds your three values and create an array of that type:
    public class SomeData {
      public int row;
      public int col;
      public int value;
    // somewhere else:
    SomeData[] a = new SomeData[10];
    a[0] = new SomeData();
    a[0].row = 10;
    a[0].col = 5;
    a[0].value = 42;Note how you only assign a single value to the element (a[0]) itself. All other assignment actually go to fields of the object refered to by that element in the array.
    Also note that in Java types (such as classes, interfaces, ...) should start with a upper-case letter, while variables (local variables, members, parameters) and method names should start with a lower-case letter.
    Edit: I'm getting old ...

  • How could I assigning object values to internal table?

    CREATE DATA dref TYPE TABLE OF (table).
        ASSIGN dref->* TO <intab>.
        SELECT * FROM (table) INTO CORRESPONDING FIELDS OF TABLE <intab>.
    I have create a internal table intab1.
    obviously, the expressing "intab1 = <intab> " is wrong.
    then,how should intab1 get the value of <intab>?

    Hi
    If you need only to transfer all data: <b>INTAB1[] = <INTAB>[]</b>. But INTAB1 has to be as <INTAB>.
    If the structure of INTAB1 is different, you have to use the field-symbols:
    LOOP AT <INTAB> ASSIGNING <WA>.
      ASSIGN COMPONENT SY-INDEX OF STRUCTRE <WA> TO <VAL_F>.
      IF SY-SUBRC <> 0. EXIT. ENDIF.
      ASSIGN COMPONENT SY-INDEX OF STRUCTRE INTAB1 TO <VAL_T>.
      IF SY-SUBRC <> 0. EXIT. ENDIF.
      <VAL_T> = <VAL_F>.
    ENDLOOP.
    So how to transfer the data depends on the structures of INTAB1 and <INTAB>.
    Max

  • How i can assign multiple values to tabuler text item (Help)

    HI
    IM PROGRAMMING ONE FORM AND I PUT THERE TABULER TEXT ITEM
    I WANT ASSIGN 63 VALUES TO THIS TEXT ITEM ONE BY ONE BY CODE I MEAN PUT FIRST VALUE IN THE FIRST TEXT ITEM ROW THEN SECOND TO THE SECOND TEXT ITEM AND LIKE THIS UNTIL I REACH TO THE LAST
    I MAKE LOV PUT I CAN ASSIGN ONE VALUE BY ONE VALUE EACH TIME DOUBLE CLICK ON THE TEXT ITEM ASSIGN ONE VALUE THEN DOUBLE CLICK ON THE SECOND ROW PUT MY BOSS WANT ASSIGN ALL VALUES 63 FROM ONE CLICK ON BUTTON

    Then you will have to create a when-validate-item trigger with a cursor based on your selection of your LOV . Loop through that cursor assigning the next in the next record by using the built-in function next_record. (put you selection for you value in a hidden item for example.
    something like this:
    Declare
    cursor c is
    select returnValueFromLOV
    from <yourtable>
    where yourdisplay value = :hidden_tem;
    begin
    for r in c loop
    next_record;
    item := r. returnValueFromLOV;
    end loop;
    exception
    when no_data_found
    your error handling;
    end;
    Hope it put you on the road to reach what you want
    Erwin

  • How do you assign a value to the APEX field APP_USER

    Application Express 4.0.2.00.07
    Hi
    Is there a special function/procedure to assign a value to the APP_USER field
    or a simple APP_USER := :P1_LOGIN_NAME would do
    Z

    Hello Zac,
    >> or a simple APP_USER := :P1_LOGIN_NAME would do
    The APEX engine is already doing it for you after a successful login – setting the value of APP_USER as the user login name. You can use it as a substitution string or with the bind variable notation (:APP_USER).
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • How to achieve matrix cell value of systems forms matrix ?

    Hi,
    When user types data in perticular cell of matrix in system Form , i want to achieve that data.
    How can i achieve that data ?
    Do any one have some sample code plz. fwd it.
    Regards,
    Ganesh

    Hi Makarand,
    This should do the trick.
    <b>Code (C#):</b>
    public override void Handle_ItemEvent(string FormUID, ref ItemEvent pVal, out bool BubblesEvent)
      /* Switch by eventtype */
      switch(pVal.EventType)
        case BoEventTypes.et_VALIDATE:
          /* Get a matrix object */
          Matrix oMatrix = (Matrix)SBO_Application.Forms.Item(FormUID).Items.Item("MY_MATRIX_ID").Specific;
          /* Get a EditText object for the matrix cell */
          EditText oEdit = (EditText)oMatrix.Columns.Item("COLUMN_ID").Cells.Item("ROW_NUMBER").Specific;
          /* Get the value from the object */
          string sValue = oEdit.Value;
          /* Do other things you like ;) */
          break;
    Hope it helps,
    Rowdy

  • How do you assign a value to an expression in a composite component?

    Hi all,
    I have just started out on JSF 2.0 not too long ago. I am trying to create a composite component that can execute a method defined by the user and then assign the returned results to a bean, also defined by the user.
    Something like the one below:
    <composite:myComponent value="#{someBean.someProperty}"  action="#{someBean.someActionMethod}" />If its just executing the method, I have no problems with that. But I do not know how to assign the returned value. Can anyone enlighten me on how to execute the method in the component and then assign the returned value to the bean?
    Thank you.
    Edited by: honsho on Aug 4, 2010 1:36 AM

    I am not sure about that. Do you mean that all I have to do is provide the interface <cc:attribute name="value" type="lvl1.lvl2.someClass"/> and when I run the method, the returned result will be written into the expression provided in "value"?

  • How do I assign the value of a Boilerplate Text Object to a Placeholder Column?

    I have a Boiler plate File Link. This references a .txt file. I want to generate XML tags for it.
    Is it possible to read the content of the file link object into a Placeholder column so that I can get a tag generated for that?

    Hi Frank,
    The key is already passed from a previous page. To set the scene a little, I have three pages:
    1. Project list, has a table listing all projects.
    2. Drill down to tasks for a project, passing the project key as a page property. This is a master/detail page. This currently works well.
    3. Create a new task for the project from page 2. I want to pass the project key obtained from page 1 to page 3 via page 2, so that the user does not have to re-select a project when creating a task.
    Here is my registrydef from page 2 (the tasks for a project):
    <bc4j:rootAppModuleDef name="ProjectModule"
    defFullName="ProjectPackage.ProjectModule"
    configName="ProjectModuleLocal"
    releaseMode="stateful">
    <bc4j:viewObjectDef name="ProjectsVO1">
    <bc4j:rowDef name="ProjectRow" autoCreate="false" usesCurrency="true">
    <bc4j:propertyKey name="key"/>
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    <bc4j:viewObjectDef name="TasksVO2" rangeSize="20"/>
    </bc4j:rootAppModuleDef>
    This works well, I can display the selected project and then list the tasks in a table.
    My problem is that in page 2 the project record is not in a table, so I cannot use a table selection mechanism to set the key value in the event which calls page 3 (see my earlier post for this code). As the key that I need is sittng there in the URL as a page property, I want to pass that instead. How to I reference it from within an event?
    Does this make sense or is there a better way of doing it? Do I actually need a new page to create a new task - I don't think I can add new records in a table!
    Thanks for the tip on ctrl: , I'm slowly getting the hang of the namespace thing.
    Steve

  • How do you assign a value for Products in a Pop-up menu?

    I am preparing production cost spread sheet. In one column I2 - I have a pop up menu with lamination types to be selected - ie: None, Standard Film, Vehicle Film, Liquid Coating. I want to be able to associate values of these costs in column J2 - On another table (Laminating Costs) I have set values for each product ie: None = 0, Standard Film = $1, Vehicle Film =$2 and Liquid Coating =$0.5 -
    Therefore if I select Liquid Coating from the from the Pop-up menu in I2 on the main spread sheet - I want to see the associated cost of $0.5 appear in J2 by referencing the Laminating Costs table - I have tried various SUMIF formulas with no luck - Could someone point me in the right direction please.
    Thanks

    You can assign values to the items using a lookup table.
    http://discussions.apple.com/thread.jspa?threadID=2539456&tstart=0

  • How to create & Assign unique Qualification level and Groups(Each trans.)

    Hi,
    While working on CRM_LEAD i have observed that i cannot create unique Qualification level or Groups/origins for each transactions, if i add one more Qualification level or Groups/origins in existing table it is reflecting in all corroseponding Leads.
    Please tell me how to create seperate Qualification level and Groups/origins for each Transaction, else we can use Authorisation Object for this.
    Please resolve.
    Regurds,
    Dipesh.

    Hi Chirag,
    I've read the following link, but the question is....
    - Where is the link to create transport groups? That is my only question It's as easy as that
    Found it...sorry I knew it was easy
    Edited by: Gonçalo Mouro Vaz on Dec 20, 2007 5:13 PM

  • How to achieve transport of value mapping replication cache table values ?

    During the migration of our interface from XI3.0 to PI 7.11,
    I need to transport the value mapping replication cache table values present in cache monitoring of runtime workbench in
    XI 3.0 PRD  to PI 7.11 DEV .
    Please let me know the ways to acheive this so that I can have the same values present in PI 7.11 Value Mapping Cache table as maintained in XI 3.0.
    Please point me into correct direction.
    Regards
    PS

    Click on "Tools" option, select "Export Configuration Objects" -> "Individual Objects" -> Choose the "Value Mapping Group" type, and then select the value mappings you want to transport.

  • How to achieve round off value in SAP?

    here I have given my Query ..I need to calculate rounding off value for this query..
    SELECT (CAST($[OBTN.U_Length] AS FLOAT)/CAST($[OBTN.U_Width] as FLOAT) *($[BTNT.Quantity]))

    Hi Karthick,
    I am not sure wheter I understood you, but are you searching for
    SELECT FLOOR((CAST($[OBTN.U_Length] AS FLOAT)/CAST($[OBTN.U_Width] as FLOAT) *($[BTNT.Quantity])))
    regards,
    Maik

  • How to dynamic assign text value to a textbox

    Hi
    As titled, I cannot find the Textbox.text property so I can put in expression or where can put it.. ?!
    It is a title textbox under a TABLIX ...
    Thanks

    Do a right-mouse click on the text box => "Expression".
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to check empty string and null? Assign same value to multiple variables

    Hi,
    1.
    How do I check for empty string and null?
    in_value IN VARCHAR2
    2. Also how do I assign same value to multiple variables?
    var_one NUMBER := 0;
    var_two NUMBER := 0;
    var_one := var_two := 0; --- Gives an error
    Thanks

    MichaelS wrote:
    Not always: Beware of CHAR's:
    Bug 727361: ZERO-LENGTH STRING DOES NOT RETURN NULL WHEN USED WITH CHAR DATA TYPE IN PL/SQL:
    SQL> declare
      2    l_str1   char (10) := '';
      3    l_str2   char (10) := null;
      4  begin
      5  
      6    if l_str1 is null
      7    then
      8      dbms_output.put_line ('oh STR1 is null');
      9    elsif l_str1 is not null
    10    then
    11      dbms_output.put_line ('oh STR1 is NOT null');
    12    end if;
    13  
    14    if l_str2 is null
    15    then
    16      dbms_output.put_line ('oh STR2 is null');
    17    elsif l_str2 is not null
    18    then
    19      dbms_output.put_line ('oh STR2 is NOT null');
    20    end if;
    21  end;
    22  /
    oh STR1 is NOT null
    oh STR2 is null
    PL/SQL procedure successfully completed.
    SQL> alter session set events '10932 trace name context forever, level 16384';
    Session altered.
    SQL> declare
      2    l_str1   char (10) := '';
      3    l_str2   char (10) := null;
      4  begin
      5  
      6    if l_str1 is null
      7    then
      8      dbms_output.put_line ('oh STR1 is null');
      9    elsif l_str1 is not null
    10    then
    11      dbms_output.put_line ('oh STR1 is NOT null');
    12    end if;
    13  
    14    if l_str2 is null
    15    then
    16      dbms_output.put_line ('oh STR2 is null');
    17    elsif l_str2 is not null
    18    then
    19      dbms_output.put_line ('oh STR2 is NOT null');
    20    end if;
    21  end;
    22  /
    oh STR1 is null
    oh STR2 is null
    PL/SQL procedure successfully completed.
    SQL> SY.

Maybe you are looking for

  • Calling a method from a UICommand Object

    How do I call an action method from a UICommand object? I create a HtmlCommandLink in my backing bean, and I think I should be setting the action, but with what? The method takes a MethodBinding but I can't find much detail on how to get that. I just

  • How to change the status of clinical order header

    Hi all, I need to change the status (N1CORDER-WLSTA) of the clinical order header. I have found the way to change the status of the items and it works, but i dont know how to change the header status. Now, for the items i do: 1- Create an object type

  • Problème de mise à jour LR

    Bonjour. Le code de la version 6 de Lightroom, que je viens d'acheter sur Internet, figurant sur mon compte Adobe, ne fonctionne pas ! Comment faire ?

  • Multiple Instance of XI in one BOX ?

    Hi All, Is it possible to install two instances of XI (say DEV and QA environment) in one box.I understand for the abap stack we can use different system numbers for different environment.For the java stack,the port would then include the system numb

  • HT5312 Resetting/ Being told my security questions. Please Help!!!!!

    Back when I created my account, I wasn't asked for a rescue email. This was years ago. How can I change my ID questions? Or at least get the answers? Without changing them, I can't download ANYTHING. What ***** more is that I'm also 18, so I should h