Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Fr 24.06.05 09:52 
Hallo, ich weiß jetzt nicht kann man LIKE gemischt mit anderen vergleichsoperatoren verwenden?
Oder kann man LIKE durch ~ ersetzen?

Wie sehe die Anweisung mit LIKE und vergleichsoperatoren gemischt aus?
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Fr 24.06.05 10:01 
select * from t_bla where name = 'test' and nname like 'oderso';

Oder wie meinen?

_________________
Stellen Sie sich bitte Zirkusmusik vor.
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Fr 24.06.05 11:37 
user profile iconopfer.der.genauigkeit hat folgendes geschrieben:
select * from t_bla where name = 'test' and nname like 'oderso';

Oder wie meinen?


Ach so verstehe gemischt einfach nutzen, sicher richtig so?

Aber mit ~ anstatt LIKE:
z.B SELECT * FROM table WHERE name = 'tumbotschka' and vorname ~ '%omber' //gibts nicht?

Auserdem gilt das % Zeichen in LIKE für beliebig viele Zeichen oder nur ein Zeichen?
Und kann man auch so schreiben %bla% oder auch %bla%bla% ?
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Fr 24.06.05 12:25 
user profile iconJRegier hat folgendes geschrieben:

Ach so verstehe gemischt einfach nutzen, sicher richtig so?

Aber mit ~ anstatt LIKE:
z.B SELECT * FROM table WHERE name = 'tumbotschka' and vorname ~ '%omber' //gibts nicht?

Auserdem gilt das % Zeichen in LIKE für beliebig viele Zeichen oder nur ein Zeichen?
Und kann man auch so schreiben %bla% oder auch %bla%bla% ?


1. Ja
2. ~ statt like? wenn die DB das kann?!
3. beliebig viele Zeichen
4. Ja.
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Fr 24.06.05 12:52 
Vielen Dank, Leute! Damit ist die Frage beantwortet!