How to inner join 2 different types of data
I have 2 tables. and I want to get the name of the branch of table2... but the thing isI have 2 different data type to bind or join the two tables.
tbl1
-user
-branch_id (number) e.g. 1,2,3...
TBL2
-branch_code (varchar2) e.g. 001, 002, 003...
-branch_name
995017 wrote:
Unfortunately. table 2 has a value of character branch code: (.)
Well, you can do a join for rows that are convertible to amount
select
branch_id
,branch_code
from
tbl1,
(select branch_code from tbl2
where
-- this is valid for positiv integers
translate ( branch_code , 'a1234567890', 'a') is null
) tbl2
where
branch_id = to_number( branch_code )
You can also go further and clean the "dirty branch_codes." To help this, you give some examples of invalid data.
Published by: chris227 on 20.03.2013 05:19
Published by: chris227 on 20.03.2013 05:20
Tags: Database
Similar Questions
-
How can insert different types of data in the table?
Hello
How can I insert different types of data in the table, (e.g., numeric and string) in the same index of a table.example:
index0 car 10 greencar red 11 index1
Index2 car Blue 12where green car red and blue car as string and 10, 11 and 12 in the numeric form.
then I extracted 10, 11 and 12 a digital tableand, the green car, red car, blue car in a string array
Help!
Use 'Analysis of the chain' as in the picture as an attachment. This will extract the number and color that you can add tables later.
-
How to ensure the separation of data from different types of data for ESXi 4?
Does anyone have a reference architecture to ensure the separation of the point of creating data in transit and storage of different types of data
example PCI DSS data (personal credit card), data ITAR/EAR, etc. Concern is due to the mix of data VLAN or crossed, VLAN themselves not to use as a security boundary. VMware offers to ensure the separation at the application levelif I read it correctlywell in transit even in stockdata must be separated. Suggestions?Hello VMwear8,
The chances of anyone to play with the hypervisor itself is actually quite thin, what must be addressed is the data accessed in virtual machines. If you need protect administrators to access these data.
Right now that is not possible to 100%, however you can restrict access by implementing different controls:
(1) execute all access to your ESX hosts and vCenter via the HyTrust appliance, this is a preventive measure in some cases.
(2) turn off the navigation data store in the vSphere Client (this is a RBAC vCenter)
(3) turn off 'root' or superuser for each ESX host (except in a situation of "break the glass"). If they need access 'root' follow it via sudo.
(4) add the audit in order to know who did what, when, where and how
(5) protect your management tools as if they were gold. Check out this post performance and security management in the virtual environment tools as an aid to help with this.
At most you can only put controls around the problem, we can not currently permanently prohibit access to one person give you access as being able to connect as root in the ESX host.
Best regards
Edward L. Haletky
Host communities, VMware vExpert,
Author: VMware vSphere and Virtual Infrastructure Security,VMware ESX and ESXi in the 2nd business edition
Podcast: the Podcast for security virtualization of resources: the virtual virtualization library
-
Initializing the elements of the array to different types of data
Hello!
Receiving data sring and write it in the table. Shot data consist of different types of data, so now I have to initialize my element of berries somehow to correct the data type. Table example:
char
char
int
int
float
float
Is it possible somehow? Or should I use the formula node or something like?
Thank you! (new)
These data resembles a cluster to create a cluster, you can create a constant of cluster on the comic book and use the cast function to fill in the cluster. Some things you need to be aware of:
What is the size of the Int?
What is the size of the float?
What is SSE-endian data.
Here are two examples:
Tone
-
Hi all
When I checked in content with 2 attached word file, ucm console showed me a messsage:
Content Server request failed
Content item "OCS517769-000199' was not archived successfully." Primary and alternate files must have different extensions.
So I can not check content with 2 attached files of the same type of document? It's amazing.Excellent. Glad I could help. Feel free to report the answer as 'Correct' if it was the solution you need if you have a chance. I need to catch up with the rest of the people!
Published by: AJ Lee on August 4, 2010 23:08
-
How to compare two different types of data
I have two columns from two tables
Suppose
Select ced.incident_id in the cs_estimate_details Dec, question ra_customer_trx_lines_all where ratl.interface_attribute6 = ced.order_line_id and org_id = 101 and ced.incident_id = 22222;
Here the error call 01722 - invalid number
This is the scenario
in fact the data type is not valid
But even if I need to contact how can I do this.
Published by: Sandy on June 24, 2010 05:46SQL> create table t1 as select level col from dual connect by level <= 10; Table created. SQL> create table t2 (col varchar2(2)); Table created. SQL> insert into t2 select level col from dual connect by level <= 10; 10 rows created. SQL> update t2 set col = 'A1' where col = 1; 1 row updated. SQL> select * from t1, t2 where t1.col = t2.col; select * from t1, t2 where t1.col = t2.col * ERROR at line 1: ORA-01722: invalid number SQL> select * from t1, t2 where to_char(t1.col) = t2.col; COL CO --------- -- 10 10 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 9 rows selected. SQL>
T1.Col = NUMBER
T2.Col = VARCHAR2You can read these:
http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:45012348053
http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:11504677087008 -
Different types of data in the table
Hello
I have problem with creating a table that contains different data types (in particular, string, intiger, boolean)
I'll be thankful, if somebody give me some advice how to fix thisThanks in advance
You must convert all data channels. A table is nothing more that an array of strings 2D and all the elements in an array must be the same data type.
-
DESC, showing the different type of data value via dblink
Hi friends,
We have two databases and for two of them, the configuration is as below
Version of the operating system: Solaris 5.10
DB version: 10.1.0.4
For security reasons, I'm going by names of junk. Assume the names of database DB1 and DB2.
We have a table T1 S1 schema of database DB1. to extract data from this table in DB2 in schema S2, we created a database DB1 and DB2 (lets say the name of dblink is XYZ)
In DB1, in table T1, we have a column by name SYS_CREATED and its data type is varchar2(40 char).
After you create the database link, below we have the table as desc
DESC S1. T1@XYZ
When we describe this statement, instead of showing the value of data type of column SYS_CREATED as varchar2(40 char), it's showing as varchar2(160 Char).
Then, we created a table in DB2 under schema S2 as below
SQL > create table S2. T2 in select * from S1. T1@XYZ;
and now, when we describe the table T2, its original display value is varchar2 (40 Char).
Then just when we described, it shows a higher value for the data type and when we create the table, his watch even than the original. In addition, what is happening to only varchar2 datatype. other data types such as number or tank remain same even when we describe.
one thing is, when he demonstrated a different value using describe, sound exactly multiplying by 4 times. for example, if we have varchar2 (1000 char), the varchar2 (4000 tank) showing
I would like to know if anyone in this strange situation earlier, if so, what is the reason?
Thank you very much in advance
> Unlike when you access a local object, the
SELECT
privilege is required to access a remote object because the database has no distance describe ability. The database must be aSELECT *
on the remote object to determine its structure.http://docs.Oracle.com/CD/B28359_01/server.111/b28310/ds_concepts002.htm
What happens if you give the right to select on the remote object.
Concerning
Girish Sharma
-
data binary file plugin: navigate through different types of data
Hello
I am currently trying to load a binary file in DIAdem with the following structure:
block 1
1 x 8 - bit ascii
12 x double
block 2
int16 1280 x
block 3
int16 1280 x
block 4
12 x double
Block 5
int16 1280 x
block 6
int16 1280 x
block 7
12 x double
block 8
int16 1280 x
block 9
int16 1280 x
...
I managed to read the first value chain, but I did not get any further.
Could you please give me an advance on how to proceed?
/ Phex
Hello Phex,
Try this. Not sure its exactly what you are looking for, but probably close.
Andreas
-
Change the shape with an Inner Join - cannot update or remove data?
Hi all
I have an edit form which shows me the data in 2 tables (through an internal SQL-statement Join). I just realized that I can't edit data more, appears the following error msg:
Internal error in the routine mru: ORA-20001: no data available in table form
Error failed to process the update.
Ok
Can someone help me please?Hello
A form can run only on a single table or view. Take a look at: report & form on several table which gives an example of creating a SQL view and an INSTEAD OF trigger. Once you have those in place, you can use the SQL view as if it were a regular table. Note that you must ensure that each "record" on this point of view has a unique value (usually a primary key), so SQL knows what "record" to update.
Andy
-
Decode and different types of data
Hello
I am using the function decode like this
SELECT decode(:p_group_by_value, 2,rl.group_code , 3,r.relative_code , 4,r.REG_DATE, null)
and there is an error because inconsistent datatypes (4, reg_date).
is there a way to avoid this error? or a replacement for the decode function?
Thanks in advance
Yes, it will not work.
think about doing it. Use to_char for all.
so the numbers also convert char using to_char.
SELECT decode (: p_group_by_value, 2, to_char (rl.group_code), to_char (r.relative_code), 3, 4, to_char (r.REG_DATE), null)
Hope this will help you...
-
unite with different types of data
Hi all
I am working in Oracle 10 g R2.
I have the following function and each record would have one of the below fields filled... where Im trying to get the value non-zero to be the 'actual_data '. When I try to run I get the following error
VALUE_NBR is a NUMERIC field in the table
VALUE_DT is a DATE field in the table
VALUE_CD is a VARCHAR2 in the table
VALUE_TXT is a VARCHAR2 in the table
ORA-00932: inconsistent datatypes: expected NUMBER got DATE
Please suggest me a solution or an alternative... I tried NVL... who had the same error as well.COALESCE(VALUE_NBR,VALUE_DT,VALUE_CD,VALUE_TXT) AS ACTUAL_DATA,
Thanks in advance
HUConvert the dates and numbers to strings:
coalesce( to_char(value_nbr) , to_char(value_dt, 'yyyymmddhh24miss') -- or some other format mask , value_cd , value_txt ) as actual_data,
-
inner join is not eliminating duplicates!
Name of the table is customers
VALUE CITY SIDE NUMS CNAME
1 2001 Hoffman 100 1001 London
2 Rome 2002 200 1003 Giovanni
3 2003 Liu San Jose 200 1002
4 2004 grass Berlin 300 1002
5 2006 Clemens 100 1001 London
6 2008 Cisneros San Jose 300 1007
7 2007 perish Rome 100 1004
Query is
To find all pairs of customers having the same side
I tried:
SELECT c.cname, cb.cname FROM customers c INNER JOIN customers cb WE cb.rating AND c.cname = c.rating! = cb.cname
CNAME CNAME
1 perish Hoffman
2 Clemens Hoffman
3 Liu Giovanni
4 Giovanni Liu
5 Cisneros grass
6 perira Clemens
7 Hoffman Clemens
8 grass Cisneros
Clemens 9 perish
10 Hoffman perish
Ideally, it should up to 5 rows, but it does not return these lines for an e.g. Hoffman perish since I'm Perira Hoffman already. Your answers will be appreciated.
Thank you
VaibhavHi, Vaibhav,
914683 wrote:
Name of the table is customersVALUE CITY SIDE NUMS CNAME
1 2001 Hoffman 100 1001 London
2 Rome 2002 200 1003 Giovanni
3 2003 Liu San Jose 200 1002
4 2004 grass Berlin 300 1002
5 2006 Clemens 100 1001 London
6 2008 Cisneros San Jose 300 1007
7 2007 perish Rome 100 1004Query is
To find all pairs of customers having the same sideI tried:
SELECT c.cname, cb.cname FROM customers c INNER JOIN customers cb WE cb.rating AND c.cname = c.rating! = cb.cname
Perhaps what you want is
SELECT c.cname , cb.cname FROM customers c INNER JOIN customers cb ON c.rating = cb.rating AND c.cname < cb.cname -- not != ;
CNAME CNAME
1 perish Hoffman
2 Clemens Hoffman
3 Liu Giovanni
4 Giovanni Liu
5 Cisneros grass
6 perira Clemens
7 Hoffman Clemens
8 grass Cisneros
Clemens 9 perish
10 Hoffman perishThe title you chose for this thread is "inner join is not eliminating duplicates!
Inner joins (or other types of joints) are not supposed to remove duplicates. Use SELECT DISTINCT to remove duplicates, which is exactly the same lines.
You don't have to duplicate. For example, these lines of your result set:` CNAME CNAME 1 Perira Hoffman 10 Hoffman Perira
are not identical; Indeed, the two columns are different.
Ideally, it should up to 5 rows, but it does not return these lines for an e.g. Hoffman perish since I'm Perira Hoffman already.
Please report the exact output of the sample data you want. (As said by Hoek, post CREATE TABLE and INSERT statements for the sample data too.)
-
different type of terminals of elapsed time of the DAQ assistant
I connected a digital relay to one of the outputs. I have installation wizard DAQ to operate a valve with the relay. Now, I want to control the valve to drive all... .lets say 20 seconds, until I stop the program. What I need, is to change the State of each 20 seconds. I tried to use the "Out of time", but when I try to connect 'elapsed time' 'Data' on the ass of data acquisition. It reports on the different types of data. What would be the way easy and clean to use a "timer" to operate a relay on a basis of time fixed and periodic? Thanks in advance!
I enclose a picture of my horrible test...
I'm using Labview student 2009 edition.
Put an is not in there also.
-
File containing different types of question
Hello
I have a use case where I need to play the file with different types of data delimiter, for example:
ABC, 123, xyz
Thank you.
Hello
This seems doable with nxsd. In our case, each line seems to be a different record type and you can handle this case with a sequence of elements (one for each record type).
For example,.
<[...]>
[...]>
Maybe you are looking for
-
USB 2.0 does not work in bootcamp Windows 10
Hello I try to use my USB 2.0 USB drive on my MBP 13.3 "in bootcamp Windows 10 and it does not appear in windows Explorer. The USB key is displayed in the device however Manager. I tried my hard drive that is USB 3.0 and it works fine, but the USB do
-
I sincerely doubt why firefox may be interested in changing my user controls in my computer? It's just a question of security only firefox can respond and until then I refuse to change my user controls. Is this right? This has happened Each time Fire
-
How to transfer libraries from Final Cut Pro to another hard drive?
as you can see, my final cut pro and iMovie libraries take up a lot of space. I would like to move into my external hard drive and remove the internal hard drive. I am worrying that the editing software will not be able to know where libraries are, s
-
ListField onFocus() calling repeatedly
Hello For OS 6.0, nobody knows what are the onFocus() method of a ListField causes several times if you hold your finger down on an empty area of the ListField (where there is no line) and move you your finger? I don't see this behavior on 5.0. I d
-
Smartphones blackBerry 7.1 update
Hi, since I'm updated my 7.1 BB9810 my camera does not work? can you help me? THX Wolfgang