query using LIKE

weretiger

Registered User.
Local time
Today, 09:59
Joined
Feb 16, 2015
Messages
10
I have 2 tables, and each table having different information and i want to link those 2 and grab information from both tables.

from below tables, i want to map the Qtree and then grab the rest of the information. for e.g. qtree1 suppose the same as qtree1/a

Table 1
Qtree | Mountpoints | Hostname
qtree1 | MP1 | Host1
qtree1 | MP2 | Host1
qtree2 | MP2 | Host2

Table2
Qtree | InstallDate | Owner
qtree1/a | 1-JAn | Vic
qtree2/a | 2-Jan | Gab

Now, How can i map the Qtree since i cant use = as the qtree are different name.

I tried to use LIKE but no luck as well.

btw, in actual... qtree looks like

//amsdc1-s-12345.europe.xxx.com/dhc-amsdc1-s-03015$
/dev/backuppool02

from above....

/dev or //amsdc1-s-12345.europe.xxx.com/ will appear in the other table to map the rest of information.
 
..
btw, in actual... qtree looks like

//amsdc1-s-12345.europe.xxx.com/dhc-amsdc1-s-03015$
/dev/backuppool02

from above....

/dev or //amsdc1-s-12345.europe.xxx.com/ will appear in the other table to map the rest of information.
Could you explain, what exactly do you mean?
And what do you mean when you write "Map"?
 
Code:
FROM table1
INNER JOIN table2
ON Instr(table2.Qtree,table1.Qtree)
 
Do you have any control over the data in the database? If you are importing the data you can filter it upon import for example.

Easiest solution is to stack querys....
Make a query something like so
Code:
Select Left(qtree, instr(3,qtree,"/", 1)) ServerName, ... other fields ....
From yourtable
Now simply save the query and use that as your source for further queries.
 

Users who are viewing this thread

Back
Top Bottom