vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi NG, I have the following command: UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE lieux.NOM_1 LIKE personnes.GEBURTSORT LIMIT 0,1); How Can I tell Mysql to select all entries who ends with the data from personnes.GEBURTSORT ? like: UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE lieux.NOM_1 LIKE %personnes.GEBURTSORT LIMIT 0,1); Sebastian |
| |||
| On 17 Dec, 13:34, "Sebastian Busch" <s...@server.com> wrote: > Hi NG, > I have the following command: > UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE lieux.NOM_1 > LIKE personnes.GEBURTSORT LIMIT 0,1); > > How Can I tell Mysql to select all entries who ends with the data from > personnes.GEBURTSORT ? > like: > UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE lieux.NOM_1 > LIKE %personnes.GEBURTSORT LIMIT 0,1); > > Sebastian How are you expecting ySQL to know in which record the field GO_ID is to be set and how are you expecting it to be set to multiple values? What you haev posted does not make sense, so maybe post an example of what you expect to happen. |
| |||
| "Captain Paralytic" <paul_lautman@yahoo.com> schrieb im Newsbeitrag news:4c8ab1c9-c163-4aab-8570-deeaaa2896ac@i3g2000hsf.googlegroups.com... > On 17 Dec, 13:34, "Sebastian Busch" <s...@server.com> wrote: >> Hi NG, >> I have the following command: >> UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE >> lieux.NOM_1 >> LIKE personnes.GEBURTSORT LIMIT 0,1); >> >> How Can I tell Mysql to select all entries who ends with the data from >> personnes.GEBURTSORT ? >> like: >> UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE >> lieux.NOM_1 >> LIKE %personnes.GEBURTSORT LIMIT 0,1); >> >> Sebastian > > How are you expecting ySQL to know in which record the field GO_ID is > to be set and how are you expecting it to be set to multiple values? > > What you haev posted does not make sense, so maybe post an example of > what you expect to happen. The Big Question is if I can make a LIKE call with a data field instead of: LIKE '%string' having: LIKE %table.field To expect having multiples results in the SELECT query I LIMIT the results. |
| |||
| On 17 Dec, 14:00, "Sebastian Busch" <s...@server.com> wrote: > "Captain Paralytic" <paul_laut...@yahoo.com> schrieb im Newsbeitragnews:4c8ab1c9-c163-4aab-8570-deeaaa2896ac@i3g2000hsf.googlegroups.com... > > > > > On 17 Dec, 13:34, "Sebastian Busch" <s...@server.com> wrote: > >> Hi NG, > >> I have the following command: > >> UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE > >> lieux.NOM_1 > >> LIKE personnes.GEBURTSORT LIMIT 0,1); > > >> How Can I tell Mysql to select all entries who ends with the data from > >> personnes.GEBURTSORT ? > >> like: > >> UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE > >> lieux.NOM_1 > >> LIKE %personnes.GEBURTSORT LIMIT 0,1); > > >> Sebastian > > > How are you expecting ySQL to know in which record the field GO_ID is > > to be set and how are you expecting it to be set to multiple values? > > > What you haev posted does not make sense, so maybe post an example of > > what you expect to happen. > > The Big Question is if I can make a LIKE call with a data field instead of: > LIKE '%string' > having: > LIKE %table.field > > To expect having multiples results in the SELECT query I LIMIT the results. I saw that, but your post says: "How Can I tell Mysql to select ALL entries who ends with the data from personnes.GEBURTSORT ?" If you use the limit in the post you will only SELECT 1 entry, not al of them. |
| |||
| "Captain Paralytic" <paul_lautman@yahoo.com> schrieb im Newsbeitrag news:43dcc59f-b7e0-4118-b450-c988374280af@o42g2000hsc.googlegroups.com... > On 17 Dec, 14:00, "Sebastian Busch" <s...@server.com> wrote: >> "Captain Paralytic" <paul_laut...@yahoo.com> schrieb im >> Newsbeitragnews:4c8ab1c9-c163-4aab-8570-deeaaa2896ac@i3g2000hsf.googlegroups.com... >> >> >> >> > On 17 Dec, 13:34, "Sebastian Busch" <s...@server.com> wrote: >> >> Hi NG, >> >> I have the following command: >> >> UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE >> >> lieux.NOM_1 >> >> LIKE personnes.GEBURTSORT LIMIT 0,1); >> >> >> How Can I tell Mysql to select all entries who ends with the data from >> >> personnes.GEBURTSORT ? >> >> like: >> >> UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE >> >> lieux.NOM_1 >> >> LIKE %personnes.GEBURTSORT LIMIT 0,1); >> >> >> Sebastian >> >> > How are you expecting ySQL to know in which record the field GO_ID is >> > to be set and how are you expecting it to be set to multiple values? >> >> > What you haev posted does not make sense, so maybe post an example of >> > what you expect to happen. >> >> The Big Question is if I can make a LIKE call with a data field instead >> of: >> LIKE '%string' >> having: >> LIKE %table.field >> >> To expect having multiples results in the SELECT query I LIMIT the >> results. > > I saw that, but your post says: "How Can I tell Mysql to select ALL > entries who ends with the data from > personnes.GEBURTSORT ?" > > If you use the limit in the post you will only SELECT 1 entry, not al > of them. I Just need one ID |
| |||
| On 17 Dec, 14:18, "Sebastian Busch" <s...@server.com> wrote: > "Captain Paralytic" <paul_laut...@yahoo.com> schrieb im Newsbeitragnews:43dcc59f-b7e0-4118-b450-c988374280af@o42g2000hsc.googlegroups.com... > > > > > On 17 Dec, 14:00, "Sebastian Busch" <s...@server.com> wrote: > >> "Captain Paralytic" <paul_laut...@yahoo.com> schrieb im > >> Newsbeitragnews:4c8ab1c9-c163-4aab-8570-deeaaa2896ac@i3g2000hsf.googlegroups.com... > > >> > On 17 Dec, 13:34, "Sebastian Busch" <s...@server.com> wrote: > >> >> Hi NG, > >> >> I have the following command: > >> >> UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE > >> >> lieux.NOM_1 > >> >> LIKE personnes.GEBURTSORT LIMIT 0,1); > > >> >> How Can I tell Mysql to select all entries who ends with the data from > >> >> personnes.GEBURTSORT ? > >> >> like: > >> >> UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE > >> >> lieux.NOM_1 > >> >> LIKE %personnes.GEBURTSORT LIMIT 0,1); > > >> >> Sebastian > > >> > How are you expecting ySQL to know in which record the field GO_ID is > >> > to be set and how are you expecting it to be set to multiple values? > > >> > What you haev posted does not make sense, so maybe post an example of > >> > what you expect to happen. > > >> The Big Question is if I can make a LIKE call with a data field instead > >> of: > >> LIKE '%string' > >> having: > >> LIKE %table.field > > >> To expect having multiples results in the SELECT query I LIMIT the > >> results. > > > I saw that, but your post says: "How Can I tell Mysql to select ALL > > entries who ends with the data from > > personnes.GEBURTSORT ?" > > > If you use the limit in the post you will only SELECT 1 entry, not al > > of them. > > I Just need one ID The manual is your friend here as it says: "The pattern need not be a literal string. For example, it can be specified as a string expression or table column." So based on that I would try: lieux.NOM_1 LIKE CONCAT('%',personnes.GEBURTSORT) |
| ||||
| Thanks for the answer. "Captain Paralytic" <paul_lautman@yahoo.com> schrieb im Newsbeitrag news:1178eae3-b0dd-4c30-ae1e-7a85c288381c@s19g2000prg.googlegroups.com... > On 17 Dec, 14:18, "Sebastian Busch" <s...@server.com> wrote: >> "Captain Paralytic" <paul_laut...@yahoo.com> schrieb im >> Newsbeitragnews:43dcc59f-b7e0-4118-b450-c988374280af@o42g2000hsc.googlegroups.com... >> >> >> >> > On 17 Dec, 14:00, "Sebastian Busch" <s...@server.com> wrote: >> >> "Captain Paralytic" <paul_laut...@yahoo.com> schrieb im >> >> Newsbeitragnews:4c8ab1c9-c163-4aab-8570-deeaaa2896ac@i3g2000hsf.googlegroups.com... >> >> >> > On 17 Dec, 13:34, "Sebastian Busch" <s...@server.com> wrote: >> >> >> Hi NG, >> >> >> I have the following command: >> >> >> UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE >> >> >> lieux.NOM_1 >> >> >> LIKE personnes.GEBURTSORT LIMIT 0,1); >> >> >> >> How Can I tell Mysql to select all entries who ends with the data >> >> >> from >> >> >> personnes.GEBURTSORT ? >> >> >> like: >> >> >> UPDATE personnes SET GO_ID = (SELECT lieux.NR FROM lieux WHERE >> >> >> lieux.NOM_1 >> >> >> LIKE %personnes.GEBURTSORT LIMIT 0,1); >> >> >> >> Sebastian >> >> >> > How are you expecting ySQL to know in which record the field GO_ID >> >> > is >> >> > to be set and how are you expecting it to be set to multiple values? >> >> >> > What you haev posted does not make sense, so maybe post an example >> >> > of >> >> > what you expect to happen. >> >> >> The Big Question is if I can make a LIKE call with a data field >> >> instead >> >> of: >> >> LIKE '%string' >> >> having: >> >> LIKE %table.field >> >> >> To expect having multiples results in the SELECT query I LIMIT the >> >> results. >> >> > I saw that, but your post says: "How Can I tell Mysql to select ALL >> > entries who ends with the data from >> > personnes.GEBURTSORT ?" >> >> > If you use the limit in the post you will only SELECT 1 entry, not al >> > of them. >> >> I Just need one ID > The manual is your friend here as it says: "The pattern need not be a > literal string. For example, it can be specified as a string > expression or table column." > So based on that I would try: > lieux.NOM_1 LIKE CONCAT('%',personnes.GEBURTSORT) |