Autor Beitrag
VizeTE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Di 17.09.02 20:03 
Hallo zusammen.

Ich möchte per Delphi (Local SQL) eine Datenbank sortieren. Das klappt ganz gut nur habe ich das Problem, daß zwischen Groß- und Kleinschreibung unterschieden wird. Das heißt zuerst werden alle Wörter beginnend mit Großbuchstaben alphabetisch sortiert, dann kommen jene Wörter die mit kleinen Buchstaben beginnen.

Kann man das abstellen? (Sprich Groß- & Kleinschreibung ignorieren)

MfG
VizeTE
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Mi 18.09.02 08:08 
Hi
Mit SQL leider keine Chance, weil es nicht möglich ist, nach einem Agregatfeld oder einem Funktionsergebnis z. B. Upper(spalte) zu sortieren.
Eine vernünftige Sortierfolge kriegst du nur hin, wenn du selbst dafür sorgst, dass der Inhalt der Datenfelder immer mit einem Grossbuchstaben beginnt.

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
VizeTE Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Mi 18.09.02 23:40 
Schade, naja was solls muss mal halt Alternativen finden.

Trotzdem danke, ciao.
MrSpock
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 262



BeitragVerfasst: Do 19.09.02 07:37 
Hallo VizeTE,

du kannst folgendes machen:

ausblenden Quelltext
1:
SELECT Name, Upper(Name) as UName FROM Adressen ORDER BY UName					


Das Feld UName zeigst du dann einfach nicht an.
Das funktioniert auch mit LocalSQL,

_________________
Live long and prosper
MrSpock \\//
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Do 19.09.02 08:47 
MrSpock hat folgendes geschrieben:

ausblenden Quelltext
1:
SELECT Name, Upper(Name) as UName FROM Adressen ORDER BY UName					


Das Feld UName zeigst du dann einfach nicht an.
Das funktioniert auch mit LocalSQL,


Hi Spock
leider funktioniert das nur mit LocalSQL. Nach ANSI-SQL ist das nicht möglich. IB und M$ SQL machens definitiv nicht. :( Ich hätte mir das auch schon oft gewünscht.

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
MrSpock
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 262



BeitragVerfasst: Do 19.09.02 09:06 
Hallo LCS,

das funktioniert auch bei IB (zumindest in der Version 6) über:

ausblenden Quelltext
1:
SELECT Name, Upper(Name) as UName FROM Adressen ORDER BY 2					

_________________
Live long and prosper
MrSpock \\//
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Do 19.09.02 09:32 
Cool 8)
Man lernt eben nie aus. :think:

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
neojones
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1206
Erhaltene Danke: 1



BeitragVerfasst: Do 19.09.02 11:11 
Selbst mit mySQL funktioniert das mit UPPER(name) AS alias!!

Viele Grüße,

Matthias

_________________
Ha! Es compiliert! Wir können ausliefern!
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Do 19.09.02 11:18 
Hi neojones
neojones hat folgendes geschrieben:
Selbst mit mySQL funktioniert das mit UPPER(name) AS alias!!

Das funktioniert überall. Es ging um das Sortieren nach alias. Solltest du das gemeint haben? Dann würde by MySQL wenigstens mal was funktionieren :mrgreen:

Seitenhiebundgrinsegrüsse
Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
VizeTE Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Do 19.09.02 19:55 
Hallo Zusammen.

Das klappt ja ;o)

Danke Euch Helfern

MfG
VizeTE