473,776 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieve fields with similar values from 2 tables?

Hiya,

How do i retreive fields with similar values from 2 tables?

I tried to use
(1) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like
'%p.name%'";
but it retrieves nothing at all.

(2) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like p.name";
will retrieve exact matches only, but this is not what i want.

(3) SELECT * FROM $table1 as o , $table2 as p WHERE o.name LIKE CONCAT('%',
p.name, '%');
will retrieve exact matches only.

Any advice will be appreciated.

PostScript: i posted the above in mysql groups, but problem remains, so am
trying my luck here.

TIA
Mar 17 '06
13 2205
no.mail.pls wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:Qd******** *************** *******@comcast .com...
no.mail.pls wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:FO***** *************** @comcast.com...
no.mail.p ls wrote:
>Hiya,
>
>How do i retreive fields with similar values from 2 tables?
>
>I tried to use
>(1) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like
>'%p.name%' ";
>but it retrieves nothing at all.
>
>(2) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like
>p.name";
>will retrieve exact matches only, but this is not what i want.
>
>(3) SELECT * FROM $table1 as o , $table2 as p WHERE o.name LIKE
>CONCAT('%' ,
>p.name, '%');
>will retrieve exact matches only.
>
>Any advice will be appreciated.
>
>PostScript : i posted the above in mysql groups, but problem remains, so
>am trying my luck here.
>
>TIA

You've also asked this in (at least) comp.databases. mysql and
alt.comp.da tabases.mysql (where is is much more appropriate).

And please learn how to cross-post.
Pethaps to x-post or not is a choice between the devil and the deep blue
sea, even though not all of us believe in devils, and some of us love the
deep blue sea.

Tiptoeing gently among the mines in Usenet can be a tricky bizness.

cheers


And people who want answers should follow usenet conventions - which
includes cross-posting instead of multi-posting.

Perhaps it is more accurate to say that it includes, as well as excludes,
x-posting. Sell not the devil short.

cheers


Only in your book does it include multi-posting to multiple newsgroups.

If you want the help, follow the conventions. Otherwise soon you won't
be able to get any responses to any of your questions.

Remember - we're all volunteers here. None of us are being paid to help
you. And we don't have to.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 22 '06 #11
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:E5******** ************@co mcast.com...
no.mail.pls wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:Qd******** *************** *******@comcast .com...
no.mail.pl s wrote:

"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:FO**** *************** *@comcast.com.. .
>no.mail.pl s wrote:
>
>
>>Hiya,
>>
>>How do i retreive fields with similar values from 2 tables?
>>
>>I tried to use
>>(1) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like
>>'%p.name% '";
>>but it retrieves nothing at all.
>>
>>(2) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like
>>p.name" ;
>>will retrieve exact matches only, but this is not what i want.
>>
>>(3) SELECT * FROM $table1 as o , $table2 as p WHERE o.name LIKE
>>CONCAT('% ',
>>p.name, '%');
>>will retrieve exact matches only.
>>
>>Any advice will be appreciated.
>>
>>PostScrip t: i posted the above in mysql groups, but problem remains,
>>so am trying my luck here.
>>
>>TIA
>
>You've also asked this in (at least) comp.databases. mysql and
>alt.comp.d atabases.mysql (where is is much more appropriate).
>
>And please learn how to cross-post.
Pethaps to x-post or not is a choice between the devil and the deep blue
sea, even though not all of us believe in devils, and some of us love
the deep blue sea.

Tiptoeing gently among the mines in Usenet can be a tricky bizness.

cheers

And people who want answers should follow usenet conventions - which
includes cross-posting instead of multi-posting.


Perhaps it is more accurate to say that it includes, as well as excludes,
x-posting. Sell not the devil short.

cheers


Only in your book does it include multi-posting to multiple newsgroups.

If you want the help, follow the conventions. Otherwise soon you won't be
able to get any responses to any of your questions.

Remember - we're all volunteers here. None of us are being paid to help
you. And we don't have to.


Appreciate if you can show me the convention that multi-posting is not
allowed, bearing in mind that i first asked in one newsgroup, and failing to
get a solution, i asked in another.

If what you claimed as convention is true, then i should never ask the same
question again in another newsgroup, even though there is no solution from
the first group i posted in.

And if x-posting is allowed, then i should post a question in all relevant
newsgroups simultaneously.

Is the above true?

cheers

Mar 24 '06 #12
no.mail.pls wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:E5******** ************@co mcast.com...
no.mail.pls wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:Qd******** *************** *******@comcast .com...

no.mail.p ls wrote:

>"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
>news:FO*** *************** **@comcast.com. ..
>
>
>>no.mail.p ls wrote:
>>
>>
>>>Hiya,
>>>
>>>How do i retreive fields with similar values from 2 tables?
>>>
>>>I tried to use
>>>(1) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like
>>>'%p.name %'";
>>>but it retrieves nothing at all.
>>>
>>>(2) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like
>>>p.name ";
>>>will retrieve exact matches only, but this is not what i want.
>>>
>>>(3) SELECT * FROM $table1 as o , $table2 as p WHERE o.name LIKE
>>>CONCAT(' %',
>>>p.name , '%');
>>>will retrieve exact matches only.
>>>
>>>Any advice will be appreciated.
>>>
>>>PostScri pt: i posted the above in mysql groups, but problem remains,
>>>so am trying my luck here.
>>>
>>>TIA
>>
>>You've also asked this in (at least) comp.databases. mysql and
>>alt.comp. databases.mysql (where is is much more appropriate).
>>
>>And please learn how to cross-post.
>
>
>Pethaps to x-post or not is a choice between the devil and the deep
>blue sea, even though not all of us believe in devils, and some of us
>love the deep blue sea.
>
>Tiptoein g gently among the mines in Usenet can be a tricky bizness.
>
>cheers
>
And people who want answers should follow usenet conventions - which
includes cross-posting instead of multi-posting.

Perhaps it is more accurate to say that it includes, as well as
excludes, x-posting. Sell not the devil short.

cheers


Only in your book does it include multi-posting to multiple newsgroups.

If you want the help, follow the conventions. Otherwise soon you won't
be able to get any responses to any of your questions.

Remember - we're all volunteers here. None of us are being paid to help
you. And we don't have to.


Appreciate if you can show me the convention that multi-posting is not
allowed, bearing in mind that i first asked in one newsgroup, and failing
to get a solution, i asked in another.

If what you claimed as convention is true, then i should never ask the
same question again in another newsgroup, even though there is no solution
from the first group i posted in.

And if x-posting is allowed, then i should post a question in all relevant
newsgroups simultaneously.

Is the above true?

cheers


Hi,

Allow me to drop in here.
Jerry was only warning you that multiposting can work against you.
If I see the same question in more newsgroups I follow, I almost never
answer because I don't know where to answer, and am unsure if the poster is
checking them all. Even if I perfectly well know how to help.

So you can ask for conventions and such, but that won't help. You can find
1000 opinionson how to behave on usenet.

Bottomline is that many do not appreciate multipost, and in the end it will
work against you.

(Just ment as a kind word of advise)
Best of luck,
Erwin Moller
Mar 24 '06 #13
no.mail.pls wrote:


Appreciate if you can show me the convention that multi-posting is not
allowed, bearing in mind that i first asked in one newsgroup, and failing to
get a solution, i asked in another.

If what you claimed as convention is true, then i should never ask the same
question again in another newsgroup, even though there is no solution from
the first group i posted in.

And if x-posting is allowed, then i should post a question in all relevant
newsgroups simultaneously.

Is the above true?

cheers


You should pick and choose the most likely group(s) where your question could be
asked. Then cross-post to those groups. Typically you should post to at most
three or four groups; if you need to post to more generally your question is too
broad (you haven't identified the problem yet) or you're posting to
inappropriate groups.

Once you have posted - wait at least 24 to 48 hours for a response. If you
haven't gotten a response by that time, chances are your question was not clear
or was not appropriate to those newsgroups. Seldom have I ever seen a message
go longer than that (at least in busy newsgroups) not be responded to in that time.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 25 '06 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
5270
by: AAVF | last post by:
Hi We have a problem with a query. An Access database links via ODBC to a UNIX server. To speed things, we use the ODBC to load the relevant tables to the local PC that runs Access so that all querying is done locally. One of the reports we run allows the user to list all invoices within a period. They are also allowed to select a customer code and a product set on
5
10882
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the new database. For instance, her old database has a table with Band Info in it. Her new database also has a table with Band Info in it but slightly different. I was wondering if there was an easy way to compare the fields from similar tables in...
3
10667
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems that are hard to find. The main problem I am having right now is that I have a report that is sorted by one of these lookup fields and it only displays the record's ID number. When I add the source table to the query it makes several records...
4
5081
by: jay | last post by:
I am using the dataset object to add a row to a sql server database in vb.net code, as follows: dim drow as DataRow dim cmdBld as new SqlCommandBuilder(mySqlDataAdapter) ds.tables(0).NewRow() drow("field1") = data for field 1 and so forth ds.tables(0).rows.add(drow) cmdBld = New SqlCommandBuilder(mySqlDataAdapter)
3
1877
by: fstenoughsnoopy | last post by:
Ok the complete story. I have a Contact Table, Query and Form, that are used to input and store the contact info for customers. They have FirstName, LastName and Address as the primary key fields to keep out duplicates. I am trying to put a full name box on the query, that uses the FirstName, LastName and Middle Initial and puts them together to form a full name. That I have so far. On my order database(consisting of a master table with...
2
2586
by: SueA | last post by:
Can anyone help me with the code to retrieve the name of the table that a control on a form (that's built off a query) refers to? For instance: qryMfrsAndBrands is based on the tables: tblBrands and tblMfrs formMfrsBrands is based on qryMfrsAndBrands fieldBrandName is on the form and comes from tblBrands via qryMfrsAndBrands.
13
3437
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end of the form which is submit and cancel. After i have clicked submit, the information is stored directly into my corresponding database table. My problem here is i need to retrieve back the information submitted to display all the data that the...
1
4106
maxamis4
by: maxamis4 | last post by:
Hello folks, Here is the backgroup. I am creating an agent that can find a user in LDAP and return the last logon date. Now i am not sure if with active directory you can user the SAMAccountName to retrieve the last computer the users logged on to. But i am looking for a place where i can learn this information. I was hoping someone out there could point me in the right direction. Below is my code which i have been working on. It can...
4
7558
by: Evanescent | last post by:
Hi Guys, I am trying to create a form which allows the users to retrieve records based on the values entered or chosen in the various combo boxes and textboxes, such as the customer's name, invoice number, service number and installation site. The users do not have to enter all the information for the search. Currently, for the Customer's Name Combo Box, the values are retrieved from the Information Table and when a user selects a name, the...
0
9627
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10287
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10060
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8951
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5367
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5492
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4030
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3621
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2859
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.