...
I have two tables. I will provide sample data in the tables below.
table1:
dept_id dept_name rep_id admin_lastname
10 dept of int.medicine Paul
10 dept of int.medicine Frank
20 dept of chemistry Young
20 dept of chemistry Bill
30 school of denistry kaufmann
40 research dept kapoor
40 research dept chen
table2
dept_id dept_name rep_id
10 dept of int.medicine A-M 05
10 dept of int.medicine N-Z 08
20 dept of chemistry A-G 04
20 dept of chemistry H-Z 01
30 school of denistry 10
40 research dept A-K 09
40 research dept L-Z 07
now I have to get the values for the rep_id in table1. For that I have to use the table 2. the condition is if the first character of the admin_lastname in table 1 is in the range (like A-M OR A-G OR N-Z OR A-K OR L-Z in the dept_name in table2) depending on that I will have to use the dept_id and rep_id in table2.
...
Here's an update statement that should do the trick -
tyler_durden
---------- Post updated at 06:37 PM ---------- Previous update was at 06:06 PM ----------
And in case you have Oracle version 10g or higher, you could make use of Regular Expressions -
The instr/substr approach should work across all versions of Oracle (as long as they aren't from the Jurassic age).
tyler_durden
Last edited by durden_tyler; 01-22-2012 at 06:32 PM..
This User Gave Thanks to durden_tyler For This Post:
Hi everyone...
I'm working with XLib and I want to find out the pixel value of a particular point on screen and then map it to RGB values. I used XGetImage and XGetPixel to get the pixel value, but how do I get the RGB values of the pixel?
I went through a few XLib manuals, there seems to be no... (1 Reply)
Hello,
I've been struggling with this for some time but can't find a way to do it and I haven't found any other similar thread.
I'd like to get the 'fields' in a line from a file into variables in just one command.
The file contains data with the next structure:... (4 Replies)
Hi,
Can someone help me comparing Null values.
Scenario is as follows:
I have a variable which "cache_prd" which can have either some integer or nothing(Null)
if it is integer I have to again do some comparision but these comparisons give me this error:( "line 32: [: 95: unary operator... (3 Replies)
Hi
I have a file with the values
abc
res
set
kls
lmn
ops
i want to sort this file with the null values at the bottom of the file
OUTPUT should look like this
abc
kls
lmn
ops (6 Replies)
Hello,
I have a tab-delimited table that may contain 11,12 or 13 columns. Depending on the number of columns, I want to cut and get a sub table as shown below. However, the awk commands in the code seem to be an issue. What should I be doing differently?
#cut columns 1-2,4-5,11 when 12 &... (3 Replies)
I have a program that accepts user input. For example I have mdacc that the user sets the value. I then have a class which stores the value set by the user. I use set_param to set the values in the class. I pass through it the list of user defines arguments from argv. What would be the opinion on... (0 Replies)
Hello everyone
I am doing a join command. Obviously, before I need two files sorted first. ( Both files have headers and have about 2 million lines each one )
The problem is, one of the files has null values in the key to sort (which is the first filed ). For example I have the original... (4 Replies)
Hi,
I have to text files that I want to merge by the first column. The values in the first column pretty much match for the first part. However there are some values that are present in column 1 and not present in column 2 or vice versa. For such values I would like to substitute X for the... (9 Replies)