Comparing the first four digits

Hello


I need to compare two different tables say account numbers a and b



I need to select the first four digits of the account number of 'b' and which correspond with the first four digits 'a'



for example in b if I have the account number from - 1234

I need to select all the account numbers from a starting with 1234 - like 1234567, 1234789etc.,.


Please help me

Hello

Account numbers are really numbers and not the chains?
If the two numbers have different lengths (e.g. 1234567 and 1234) do you always want to compare the first four digits?

Assuming that the answers to both is "Yes":

...
WHERE   SUBSTR (TO_CHAR (a.account_number), 1, 4) =
        SUBSTR (TO_CHAR (b.account_number), 1, 4)

If the account_numbers are really chains, omit TO_CHAR.

Tags: Database

Similar Questions

  • How to pass data to the tables according to the value of the first 4 digits of 7 strings of numbers

    I want to sort incoming data, in several bays based only on the first 4 digits of each string.

    For example, a hexadecimal string may be 41322033333533 which is A1 3353.

    A1 is a sensor. particularly, and I want to send all data from the A1 to a table. I have 8 sensors data and want to send the data to separate the bays of sensor. My sensor names are A1, A2, A3, T1, T2, T3, W1

    I will use a structure of the matter, for loop and a comparison of '=' for the data. However, I want to only compare the first 4 digits of the string and I can't find an operator for this. Any advice on how to proceed would be appreciated.

    With a thread like this

  • iPhone5 only showing the first 8 digits of the wi - fi address

    Address wi - fi is only showing the first 8 digits, then... How do I access the other 4?  Even when I turn the phone on its side for more space it does not when you view the settings screen.  I try to connect to a secure wireless network and may not without the entire address.  Any help appreciated.

    I go in settings/general/to say and it displays all my WiFi address. Yours does not work?

  • wait and trigger the first incoming digital dashboard

    Maybe it's a frequently asked question, but I managed to understand the trigger DAQmx VI. Is the trigger VI supposed to block the program until Gets an edge? It waits indefinitely?

    A screenshot of my failed attempt is attached to this message. I want to start my measurement (HAVE several channels) to the first incoming digital edge (or increment of the counter) on a system time real PXI. Before entering the loop of measure I want to wait for an edge (possibly indefinitely). Inside this loop, I want to begin to acquire the data values and counter of I.

    I even tried to use the example, but I get an error of dialog (see screenshot).

    Hello pgraebel,

    The trigger VI just configures the behavior of the acquisition.  So, once the start VI task is called, the task itself will be armed and waiting for the trigger.  You trigger attempt.jpg, what will happen is that the task is configured and started.  When starting, running VI will proceed to the loop where you call the read I.  The map will wait for relaxation, with no sample being acquired until the material sees the trigger.  If the trigger is never sent, the loop will iterate that you have not the VI wait indefinitely, but only for 10 seconds.  Thus, if no data is received, the loop will iterate every 10 seconds. If you want to read to wait indefinitely, the value of the timeout on DAQmx Read.vi-1.

    All that being said, it is not quite clear what is the problem with your attempt to trigger - everything looks good to me; are you an error?  Or the just VI hang up (which could be due to the fact that the relaxation is never received)?

    Let me know if it helps.

    Cheers, Matt

  • SQL query to get the first four characters of an address

    Hi gurus,


    Can you please help me with the below quries on how to achieve this. Could be really helpful if you could provide a sample sql on your side.


    Req:

    I have a requriement where I should display the first four characters other than a space to address, for example: becomes R, DISH etc. F. in passing in a ROOM address a DISH 1 FLORIAN AVENUE would therefore "RAF1", while a CORNER, 23 STREET address would be "23CO".


    Words such as c/o, co, rear should be ignored, if any.

    Thanks in advance.


    Kind regards

    Peoples

    Hi John,.

    Here is an implementation of a pl/sql function that suggested a franc. It uses two lists, one with the words which are replaced with the first character and a second with words to ignore.

    create or replace function first_four (p_input in varchar2) return varchar2 is

    type t_words is table of the varchar2 (100);

    p_replace t_words: = t_words ('ROOM', 'FIELD', 'FLAT', 'FLT', 'BLOCK', 'UNIT', 'STUDIOS', 'CARAVAN', 'APARTMENT');

    p_ignore t_words: = t_words ("C/o ', 'CO', 'BACK TO'");

    v_input varchar2 (100);

    Start

    -Put the entry in a local-variable he

    v_input: = upper (p_input);

    -delete the words contained in the ignore list

    because me in 1.p_ignore.count

    loop

    v_input: = replace (v_input, p_ignore (i));

    end loop;

    -Replace the words by first character in the replacement list

    for r in 1.p_replace.count

    loop

    v_input: = replace (v_input, p_replace (r), substr (p_replace (r), 1, 1));

    end loop;

    -remove the spaces and return only the first 4 characters

    Return substr (replace (v_input, ' '), 1, 4);

    end;

    /

    It returns the expected results for the four examples you gave:

    SQL > with t as)

    2 select address 'FLAT 3 a 12 LILLYHAM ROAD' of all the double union

    3 select ' GREE LANE GLOSONTH 45' across Union double

    4 Select "FLAT 3 221 b Baker Street," of all the double union

    5. Select "C/o CARAVAN 32 STREET BLOK 6 RICHMOOND' of the double)

    6. Select ff first_four (address) of t;

    FF

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

    F3A1

    45GR

    F322

    C32B

  • Insert hyphen after the first two digits

    I don't see just how I can insert the hyphen in one of my filed talbe. for example I have 123456789, 321654987 I want just to add the hyphen after the first two digits. 12-3456789, 32-1654987. Do I need an update statement to change that in my talbe. Thank you

    Of course, the column is VARCHAR2, then

    UPDATE t
       SET a = SUBSTR( a, 1, 2 ) || '-' || SUBSTR( a, 3 );
    

    Or you can leave it as it is and create a new view on the table in the format of the string you want.
    Or you can just format the selection of the table.
    Or you can add a virtual column with data formatted as you wish.

    All depends on your needs.

  • Is PAP2T possible to spend the first dialled digits?

    I have a dialler of Mitel to use my old phone pulse, but it is blocked for programming, if I dial 4321, he composed a long number transfer th 4321. Is it possible change the dialplan to ignore these digits, and onle build the rest? If so, how should I do this?

    d_s_k

    PS

    No composition first and foremost what I compose is: 131 break 1234567890 if I dial it 4321 sends 131 1234567890 4321

    DS

    If the number he composed is fixed, then you can be stripped out with the numbering plan

    Add something like this to your dial plan

    | <>xx.|

    Depending on the duration of the break after the 131, you need to increase the short interdigit timer so the numbering plan may not expire before he gets to the number after the 131.  The default short interdigit timer is 3 seconds.

    Edit: You can increase the short interdigit timer with an expression before the dial plan: S6:, ( <> xx |...) would increase the short interdigit timer at 6 seconds.

  • List of files in numerical order after the first two digits

    I have scanned documents on a usb key & saved as pdf files using a 8-digit date.  When I go to open the files, they are only in the order for the 2 first digits.  How can I get adobe to put in order using all 8 digits so that they are listed in chronological order, including the day and year?

    Adobe not in numeric order question.png

    The operating system will not sort by date like this. If you look at, it IS the 'digitally' sort 'dates' are in numerical order from the smallest to the largest.
    What I'm doing to sort by date is to use this format "YYYYMMDD".

  • How to get the first 6 digits and the last 4 digits of a string?

    Greetings people.

    A small question and probably quite simple for a lot of guys out there.

    I have a string which can be anywhere between 15 and 20 characters (not a fixed length)

    I can't be divided into 3 segments.
    Segment 1 : 123456 ( 6 digits )
    
    Segment 2 : Everything else in the string from where Segment 1 ends (+1) and Segment 3 begins (-1).
    
    Segment 3 : 1234 ( 4 digits )
    Any help is appreciated!

    Thank you
    select substr (str, 1, 6)
         , substr (str, 7, length (str) -10)
         , substr (str, -4)
      from test
    
  • How to compare one by an element of a column with the first column in the other table?

    Hello

    I have two files into a single file has only Id numbers and the second file has table with for example the column 4, and his first column identification number.

    So I want to compare the first item in the User.ID file with the 1st column all the table file items in this column until it finds matches.

    If compare match then LED will be IT other wise LED will be OFF.

    Here as an attachment, I've attached the two file.

    Please guide me how can I do the same thing.

    Thank you much in advance.


  • How to use String Manipulation Cloud Connector to shoot the first five characters of the field? (Expression syntax experience)

    The question

    I need to segment data on a large number of Postal Codes, usually about 400 to 600 at the same time. It is that our postcode field includes the last four digits in some cases, for example 92101-1957. When you use the Contact filter 'Value In A' I'm not able to do this 92101 *, 92102 * and of course I can't account for any combination of four numbers that might appear.

    The Solution - in theory

    The solution I came up with that is to create a new field of Contact in Eloqua 'Segmentation Zip Code' copy of the 5 digits of the postal Code field and execute segmentation using this new field.

    The Solution - Cloud Connector

    String Manipulation cloud connector must be able to perform this action - copy on the first 5 digits of the zip in the zip segment field field.

    When I'm stuck - via cloud connector

    I can't figure out how to write the syntax for expressions to search and replace. I have read the instructions of syntax and am still unable to establish exactly what I enter in the "regex to find: ' and the ' Regular Expressions to replace:

    Does anyone have expierence with an Expression syntax that might help train these expressions?

    Any ideas on other ways to address the problem would be too great.

    Thank you

    Louis

    Hi Louis,.

    Okay, I think I might know how to do it now but don't have access to Eloqua for the moment, so I'm kind of make this Store, but try below.

    Use the regex below in the "Regex for find" and let the "Regex to replace white": "."

    -(.*)$

    This will be after the hyphen and the replacement string will be empty, so I hope you should be left with just the first five digits that you can map to a new field.

    Let me know how you get on, I might be able to test myself so tomorrow so I'll see if I can make it work.

    Chris

  • Serial number Lightroom 5 show me the last 4 digits

    Help!

    I have 5 Lightroom on my laptop, but I want to use it on my new iMac. I downloaded the version even on my iMac, and now when I am trying to enter my serial number (from my laptop), the 4 last digits are only show as: "xxxx"... it is IM showing me the first 20 digits of the serial number, but not the last 4. Why? Help please!

    Again, I should have looked into it more before posting. At through my emails and found in there when I bought it all first.

  • read the first digit of the number of

    I'm writing a validation script simple credit card which will be just test it to ensure that the first character (s) of the cc # entered is valid for this type of card (is to say-Visa all start with '4', MC with 51 or 55').
    Can someone give me an example of code that will allow me to check for the #Form.ccnumber # first digit (or the first two digits) to make sure they match?
    Thanks in advance for any help.

    Left(cardNum,1) EQ ' 4'
    Left(cardNum,2) EQ '51' GOLD left(cardNum,2) EQ ' 52 "

  • why there are four drives in the Fable: The Lost Chapters pack but we can only use the first to play?

    original title: fable: the lost chapters
    Hello! I wonder why there are four drives in the Fable: The Lost Chapters pack but we can only use the first to play?

    My guess would be that the other 3 drives are required for installation, because they contain the installation files, but actually the game startup files are only on the 1st disk.

  • When I install the first cc in 2015 compared to the creative clouds or updates the program I can t o open it again, the 0xc000001d error code

    When I install the first cc in 2015 compared to the creative clouds or updates the program, I can't o open it again, 0xc000001d error I have windows 7 ultimate AMD Athlon (TM) II X 5 1100t processor 3.84 Ghz 16 GB RAM. How can I solve this problem I need urgent program! Thank you

    Hi Oana M.

    Update first Pro CC 2015 (9.2).

    Thank you

    Kevin

Maybe you are looking for