Konkret möchte ich alle Werte finden, die mit sechs Ziffern beginnen,
d.h. also mein Ausdruck wäre etwas wie
'^[0-9]{6}.*$'
Hi - ist zwar nicht das was man einen regulären Ausdruck nennt, aber für 
die meisten Daten wird's passen.
Wenn Du Dir sicher bist, dass es keine Einträge gibt, die 1Z3456 heißen, 
dann kannst Du einfach die 'LEFT' Funktion benutzen:
SELECT LEFT( "TextFeld", 6 ) AS "Stellen 1 bis 6",
       ( CONVERT ( LEFT( "TextFeld", 6 ) , BIGINT ) ) * 3 AS 
"Konvertiert und Plutimikation"
FROM "Tabelle1"
WHERE LEFT( "TextFeld", 6 ) >= '0'
  AND LEFT( "TextFeld", 6 ) <= '999999'
sonst musst Du jede Stelle einzeln abfragen:
SELECT LEFT( "TextFeld", 6 ) AS "Stellen 1 bis 6",
       (CONVERT(LEFT("TextFeld",6),BIGINT)) * 3 AS "Konvertiert und 
Plutimikation"
FROM "Tabelle1"
WHERE SUBSTRING ( "TextFeld", 1, 1 ) >= '0' AND SUBSTRING ( "TextFeld", 
1, 1 ) <= '9'
  AND SUBSTRING ( "TextFeld", 2, 1 ) >= '0' AND SUBSTRING ( "TextFeld", 
2, 1 ) <= '9'
  AND SUBSTRING ( "TextFeld", 3, 1 ) >= '0' AND SUBSTRING ( "TextFeld", 
3, 1 ) <= '9'
  AND SUBSTRING ( "TextFeld", 4, 1 ) >= '0' AND SUBSTRING ( "TextFeld", 
4, 1 ) <= '9'
  AND SUBSTRING ( "TextFeld", 5, 1 ) >= '0' AND SUBSTRING ( "TextFeld", 
5, 1 ) <= '9'
  AND SUBSTRING ( "TextFeld", 6, 1 ) >= '0' AND SUBSTRING ( "TextFeld", 
6, 1 ) <= '9'
Über die Convert-Funktion kannst Du prüfen ob Deine Abfrage stimmt -
sollte eine Exception kommen, dann weil ein Buchstabe oder Sonder-
zeichen nicht in einen Numerischen Wert umgewandelt werden kann.
--
Informationen zum Abmelden: E-Mail an users+help@de.libreoffice.org
Probleme? http://de.libreoffice.org/hilfe-kontakt/mailing-listen/abmeldung-liste/
Tipps zu Listenmails: http://wiki.documentfoundation.org/Netiquette/de
Listenarchiv: http://listarchives.libreoffice.org/de/users/
Alle E-Mails an diese Liste werden unlöschbar öffentlich archiviert
Context
   
 
  Privacy Policy |
  
Impressum (Legal Info) |
  
Copyright information: Unless otherwise specified, all text and images
  on this website are licensed under the
  
Creative Commons Attribution-Share Alike 3.0 License.
  This does not include the source code of LibreOffice, which is
  licensed under the Mozilla Public License (
MPLv2).
  "LibreOffice" and "The Document Foundation" are
  registered trademarks of their corresponding registered owners or are
  in actual use as trademarks in one or more countries. Their respective
  logos and icons are also subject to international copyright laws. Use
  thereof is explained in our 
trademark policy.