Hi,
I have 2 tables - Companies and List.
The table List has a Org column. I am trying to look for companies in the Companies table that are like the names in the Org column from the List table.
Do I need a loop function for this? and if so, can someone please help me to write the function?
Thanks,
ddk
7 1311
Hi,
I have 2 tables - Companies and List.
The table List has a Org column. I am trying to look for companies in the Companies table that are like the names in the Org column from the List table.
Do I need a loop function for this? and if so, can someone please help me to write the function?
Thanks,
ddk
Try this: -
-
SELECT c.* from companies c, list l WHERE c.company LIKE '%l.org%'
-
/
-
-
SELECT c.* from companies c, list l WHERE INSTR(c.company,l.org) > 0
-
/
-
-
Try this: -
-
SELECT c.* from companies c, list l WHERE c.company LIKE '%l.org%'
-
/
-
-
SELECT c.* from companies c, list l WHERE INSTR(c.company,l.org) > 0
-
/
-
-
this is returning more results than it should -
for an org name like 3M% from List, it is returning 3M, 3COM etc.. from the Companies table
this is returning more results than it should -
for an org name like 3M% from List, it is returning 3M, 3COM etc.. from the Companies table
Both the queries returning more than the expected for 3M%?
For org = 3M%, it should return records atarting with 3M followed by any number of characters or numbers.
The Instr query: I am using the query you sent over. For an Org called 3M from the List table, I see 3M, 3COM being returned in the result set from the Companies table.
The Instr query: I am using the query you sent over. For an Org called 3M from the List table, I see 3M, 3COM being returned in the result set from the Companies table.
Did you try the other one??
you know, it actually worked!!
Thanks a ton!
you know, it actually worked!!
Thanks a ton!
Even I was wondering that why it did not work properly...
Anyways, you can post back in case of any further queries.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: |
last post by:
Is it possible to extend this function to dynamically create a combo boxes
from the db table....How would do this...I tried passing a 'Select' type to
the function but got a blank entry....Any...
|
by: Sheperd |
last post by:
Hey everyone,
I have this browser detect script and the validator is having problems with
it, im trying to validate a page for XHTML 1.0 Transitional
If you have any ideas or suggestions they...
|
by: Bill Smith |
last post by:
The initial row is inserted with the colPartNum column containing a valid
LIKE pattern, such as (without the single quotes) 'AB%DE'.
I want to update the column value with the results of a query...
|
by: junk1 |
last post by:
I am running a query from a Java app via the IBM type 4 driver back to
MF DB2 and am getting a strange result.
Basically my statement is
SELECT BLAH WHERE NAME LIKE ?
....and I pass in...
|
by: David Garamond |
last post by:
Reading the archives and the FAQ, it seems to be implied that LIKE can
use index (and ILIKE can't; so to do case-insensitive search you need to
create a functional index on LOWER(field) and say:...
|
by: Roland Hall |
last post by:
In Access you use "*" + + "*", + can be replaced with &
Calling a parameterized query in Access requires % be used in place of *,
however, all that I have read show dynamic SQL passed to Access:
...
|
by: jknaty |
last post by:
I'm trying to create a function that splits up a column by spaces, and
I thought creating a function that finds the spaces with CHARINDEX and
then SUBSTRING on those values would an approach. I...
|
by: BertDick |
last post by:
I'm trying to use the IRR function in Ms Access using the code below.
Function MyIRR(mygroupid, myguess) as double
Dim Values(4) as double' an array with 5 elements
Dim x
dim rs as...
|
by: mguy27 |
last post by:
We have about 2 dozen security officers who patrol about 120 buildings. They find defective or unlocked doors and write a "Trouble Report" on the door. This card gets turned in, where I have designed...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |