Retrieve fields with similar values from 2 tables?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • no.mail.pls

    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


  • Erwin Moller

    #2
    Re: Retrieve fields with similar values from 2 tables?

    no.mail.pls wrote:
    [color=blue]
    > 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.[/color]

    Hi,

    I never saw LIKE used in that way ever before, and am unsure if that is
    possible.
    I only used/saw LIKE with a literal string, not a dynamic construct, like
    yours, joined on another table.
    I would advise you to dive into the documentation for your version of mysql,
    to first check if it is allowed anyway.

    If it is not allowed: solve the problem programmaticall y. Get the table into
    your scriptingenviro nment and solve the join in there.

    But once again: I could be completely wrong, and maybe it IS possible in
    mysql.

    Regards,
    Erwin Moller
    [color=blue]
    >
    > PostScript: i posted the above in mysql groups, but problem remains, so am
    > trying my luck here.
    >
    > TIA[/color]

    Comment

    • Jerry Stuckle

      #3
      Re: Retrieve fields with similar values from 2 tables?

      no.mail.pls wrote:[color=blue]
      > 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
      >
      >[/color]

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

      And please learn how to cross-post.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • noone

        #4
        Re: Retrieve fields with similar values from 2 tables?

        Erwin Moller wrote:
        [color=blue]
        > no.mail.pls wrote:[/color]
        [color=blue][color=green]
        >> 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.[/color][/color]
        [color=blue]
        > Hi,[/color]
        [color=blue]
        > I never saw LIKE used in that way ever before, and am unsure if that is
        > possible.
        > I only used/saw LIKE with a literal string, not a dynamic construct, like
        > yours, joined on another table.
        > I would advise you to dive into the documentation for your version of mysql,
        > to first check if it is allowed anyway.[/color]
        [color=blue]
        > If it is not allowed: solve the problem programmaticall y. Get the table into
        > your scriptingenviro nment and solve the join in there.[/color]
        [color=blue]
        > But once again: I could be completely wrong, and maybe it IS possible in
        > mysql.[/color]
        [color=blue]
        > Regards,
        > Erwin Moller[/color]
        [color=blue][color=green]
        >>
        >> PostScript: i posted the above in mysql groups, but problem remains, so am
        >> trying my luck here.
        >>
        >> TIA[/color][/color]


        I would probably do something like in PHP:

        select name from table2;

        in a while loop



        Comment

        • noone

          #5
          Re: Retrieve fields with similar values from 2 tables?

          Erwin Moller wrote:
          [color=blue]
          > no.mail.pls wrote:[/color]
          [color=blue][color=green]
          >> 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.[/color][/color]
          [color=blue]
          > Hi,[/color]
          [color=blue]
          > I never saw LIKE used in that way ever before, and am unsure if that is
          > possible.
          > I only used/saw LIKE with a literal string, not a dynamic construct, like
          > yours, joined on another table.
          > I would advise you to dive into the documentation for your version of mysql,
          > to first check if it is allowed anyway.[/color]
          [color=blue]
          > If it is not allowed: solve the problem programmaticall y. Get the table into
          > your scriptingenviro nment and solve the join in there.[/color]
          [color=blue]
          > But once again: I could be completely wrong, and maybe it IS possible in
          > mysql.[/color]
          [color=blue]
          > Regards,
          > Erwin Moller[/color]
          [color=blue][color=green]
          >>
          >> PostScript: i posted the above in mysql groups, but problem remains, so am
          >> trying my luck here.
          >>
          >> TIA[/color][/color]


          I would probably do something like in PHP:

          psuedo-code:


          select name from table2;
          while values
          select * from table1 where name like '%$table2name%'
          do more stuff... with second result set...



          Comment

          • Gordon Burditt

            #6
            Re: Retrieve fields with similar values from 2 tables?

            >>> I tried to use[color=blue][color=green][color=darkred]
            >>> (1) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like
            >>> '%p.name%'";
            >>> but it retrieves nothing at all.[/color][/color][/color]

            Unless you have a name that contains the string 'p.name', literally,
            you won't.
            [color=blue][color=green][color=darkred]
            >>> (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.[/color][/color]
            >[color=green]
            >> Hi,[/color]
            >[color=green]
            >> I never saw LIKE used in that way ever before, and am unsure if that is
            >> possible.[/color][/color]

            I don't see why not.
            [color=blue][color=green]
            >> I only used/saw LIKE with a literal string, not a dynamic construct, like
            >> yours, joined on another table.[/color][/color]

            Granted, it may not be done that way very often, but it's possible.
            [color=blue][color=green]
            >> I would advise you to dive into the documentation for your version of mysql,
            >> to first check if it is allowed anyway.[/color][/color]

            I have used:
            ... WHERE '$email' like whitelist.patte rn;

            on occasion in email filtering applications. pattern might contain
            something like '%@mycustomer.c om' or '%@%.mycompany. com'. It's not
            real efficient (MySQL probably has to do a patternmatch on every
            row, especially if the leading character in the pattern is a %, as
            it often is. But it works. And it may be much easier to use
            patterns than to use lots more fixed strings and separate tables
            for host, user@host, user, etc.

            Also possible is:

            ... WHERE normalize('$ema il') like normalize(white list.pattern);

            where the normalize() function converts to lower case, removes leading
            and trailing spaces, removes comments, etc. This one is also likely
            difficult to optimize. normalize() would either be implemented with
            stored procs or be expanded inline with calls to a bunch of other
            SQL functions.

            Gordon L. Burditt

            Comment

            • no.mail.pls

              #7
              Re: Retrieve fields with similar values from 2 tables?

              "Erwin Moller"
              <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote in
              message news:441a7f1d$0 $11065$e4fe514c @news.xs4all.nl ...[color=blue]
              > no.mail.pls wrote:
              >[color=green]
              >> 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.[/color]
              >
              > Hi,
              >
              > I never saw LIKE used in that way ever before, and am unsure if that is
              > possible.
              > I only used/saw LIKE with a literal string, not a dynamic construct, like
              > yours, joined on another table.
              > I would advise you to dive into the documentation for your version of
              > mysql,
              > to first check if it is allowed anyway.
              >
              > If it is not allowed: solve the problem programmaticall y. Get the table
              > into
              > your scriptingenviro nment and solve the join in there.
              >
              > But once again: I could be completely wrong, and maybe it IS possible in
              > mysql.
              >
              > Regards,
              > Erwin Moller[/color]

              Hiya,

              Thanks for all replies.

              The following solution posted by Jake works like a charm.

              "Jake Krohn" <krohnk@ece.cmu .edu> wrote in message
              news:dvehtp$5se $1@nntp.ece.cmu .edu...[color=blue]
              > Try this:
              > SELECT * FROM table1 a, table2 b
              > WHERE INSTR(a.name, b.name) <> 0
              > Jake Krohn[/color]

              The doc from mysql.com has this to say:
              INSTR(str,subst r)

              Returns the position of the first occurrence of substring substr in string
              str. This is the same as the two-argument form of LOCATE(), except that the
              order of the arguments is reversed.

              mysql> SELECT INSTR('foobarba r', 'bar');
              -> 4
              mysql> SELECT INSTR('xbar', 'foobar');
              -> 0
              This function is multi-byte safe. In MySQL 3.23, this function is case
              sensitive. For 4.0 on, it is case sensitive only if either argument is a
              binary string.

              cheers.



              Comment

              • no.mail.pls

                #8
                Re: Retrieve fields with similar values from 2 tables?

                "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                news:FOqdnaQ40L y9L4fZRVn-rw@comcast.com. ..[color=blue]
                > no.mail.pls wrote:[color=green]
                >> 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[/color]
                > You've also asked this in (at least) comp.databases. mysql and
                > alt.comp.databa ses.mysql (where is is much more appropriate).
                >
                > And please learn how to cross-post.[/color]

                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


                Comment

                • Jerry Stuckle

                  #9
                  Re: Retrieve fields with similar values from 2 tables?

                  no.mail.pls wrote:[color=blue]
                  > "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                  > news:FOqdnaQ40L y9L4fZRVn-rw@comcast.com. ..
                  >[color=green]
                  >>no.mail.pls wrote:
                  >>[color=darkred]
                  >>>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[/color]
                  >>
                  >>You've also asked this in (at least) comp.databases. mysql and
                  >>alt.comp.data bases.mysql (where is is much more appropriate).
                  >>
                  >>And please learn how to cross-post.[/color]
                  >
                  >
                  > 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
                  >
                  >[/color]

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


                  --
                  =============== ===
                  Remove the "x" from my email address
                  Jerry Stuckle
                  JDS Computer Training Corp.
                  jstucklex@attgl obal.net
                  =============== ===

                  Comment

                  • no.mail.pls

                    #10
                    Re: Retrieve fields with similar values from 2 tables?

                    "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                    news:Qd6dnT4CVp __d4LZnZ2dnUVZ_ vidnZ2d@comcast .com...[color=blue]
                    > no.mail.pls wrote:[color=green]
                    >> "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                    >> news:FOqdnaQ40L y9L4fZRVn-rw@comcast.com. ..
                    >>[color=darkred]
                    >>>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.dat abases.mysql (where is is much more appropriate).
                    >>>
                    >>>And please learn how to cross-post.[/color]
                    >>
                    >>
                    >> 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
                    >>[/color]
                    > And people who want answers should follow usenet conventions - which
                    > includes cross-posting instead of multi-posting.[/color]

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

                    cheers




                    Comment

                    • Jerry Stuckle

                      #11
                      Re: Retrieve fields with similar values from 2 tables?

                      no.mail.pls wrote:[color=blue]
                      > "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                      > news:Qd6dnT4CVp __d4LZnZ2dnUVZ_ vidnZ2d@comcast .com...
                      >[color=green]
                      >>no.mail.pls wrote:
                      >>[color=darkred]
                      >>>"Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                      >>>news:FOqdnaQ 40Ly9L4fZRVn-rw@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
                      >>>[/color]
                      >>
                      >>And people who want answers should follow usenet conventions - which
                      >>includes cross-posting instead of multi-posting.[/color]
                      >
                      >
                      > Perhaps it is more accurate to say that it includes, as well as excludes,
                      > x-posting. Sell not the devil short.
                      >
                      > cheers
                      >
                      >
                      >
                      >[/color]

                      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.
                      jstucklex@attgl obal.net
                      =============== ===

                      Comment

                      • no.mail.pls

                        #12
                        Re: Retrieve fields with similar values from 2 tables?

                        "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                        news:E56dnaNQVY JdJr3Z4p2dnA@co mcast.com...[color=blue]
                        > no.mail.pls wrote:[color=green]
                        >> "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                        >> news:Qd6dnT4CVp __d4LZnZ2dnUVZ_ vidnZ2d@comcast .com...
                        >>[color=darkred]
                        >>>no.mail.pl s wrote:
                        >>>
                        >>>>"Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                        >>>>news:FOqdna Q40Ly9L4fZRVn-rw@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.[/color]
                        >>
                        >> Perhaps it is more accurate to say that it includes, as well as excludes,
                        >> x-posting. Sell not the devil short.
                        >>
                        >> cheers[/color]
                        >
                        > 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.[/color]

                        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



                        Comment

                        • Erwin Moller

                          #13
                          Re: Retrieve fields with similar values from 2 tables?

                          no.mail.pls wrote:
                          [color=blue]
                          > "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                          > news:E56dnaNQVY JdJr3Z4p2dnA@co mcast.com...[color=green]
                          >> no.mail.pls wrote:[color=darkred]
                          >>> "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                          >>> news:Qd6dnT4CVp __d4LZnZ2dnUVZ_ vidnZ2d@comcast .com...
                          >>>
                          >>>>no.mail.p ls wrote:
                          >>>>
                          >>>>>"Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                          >>>>>news:FOqdn aQ40Ly9L4fZRVn-rw@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[/color]
                          >>
                          >> 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.[/color]
                          >
                          > 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[/color]

                          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

                          Comment

                          • Jerry Stuckle

                            #14
                            Re: Retrieve fields with similar values from 2 tables?

                            no.mail.pls wrote:[color=blue]
                            >
                            >
                            > 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
                            >
                            >
                            >[/color]

                            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.
                            jstucklex@attgl obal.net
                            =============== ===

                            Comment

                            Working...