MySQL Forums
Forum List  »  German

Re: [Anfänger] Wert eines benachbarten Feldes abfragen
Posted by: Thomas Wiedmann
Date: March 05, 2012 12:38AM

Hallo Uli,
dann fasse ich das bisherige noch mal wie folgt zusammen und lege eine Beispieltabelle mit Daten an. Anschließend mache ich eine SQL-Abfrage.

CREATE TABLE txp_form (
  name VARCHAR(20) NOT NULL,
  type VARCHAR(10) NOT NULL,
  form VARCHAR(100) NOT NULL
);

INSERT INTO txp_form VALUES
( 'Link1','link','feld 1<txp:link /><br /><txp:link_description />' ),
( 'Link2','link','feld 2<txp:link /><br /><txp:link_description />' ),
( 'Link3','link','feld 3<txp:link /><br /><txp:link_description />' );

SELECT name
  FROM txp_form
 WHERE form LIKE '%feld 3%';
+-------+
| name  |
+-------+
| Link3 |
+-------+
1 row in set (0.02 sec)

mysql>

Mit dem SELECT wird die Spalte "form" der Tabelle txp_form durchsucht, ob irgendwo der Text "feld 3" steht. Die Datenbank liefert eine Ergebniszeile mit der Spalte "name" und dem Inhalt "Link3". Zellen in dem Sinne gibt es in Datenbanktabellen nicht. Ich gehe davon aus, dass wir uns nach wie vor nicht komplett verstehen. Für Basiswissen eignet sich zum Beispiel dies: http://de.wikipedia.org/wiki/SQL

Grüße
Thomas

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.