Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Goetz Schultz <news.expire1225@goetz.co.uk> |
|---|---|
| Newsgroups | ger.ct |
| Subject | Re: Postgressql |
| Date | 2022-10-02 19:44 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <thcm6p$1mb4h$5@dont-email.me> (permalink) |
| References | <thckve$1mb4h$4@dont-email.me> <BIGINT-20221002193747@ram.dialup.fu-berlin.de> |
On 02/10/2022 19:39, Stefan Ram wrote:
> Goetz Schultz <news.expire1225@goetz.co.uk> writes:
>> In einem SELECT-Statement ist eines der Felder ein BigInt. Ich moechte
>> von dem BigInt-wert die letzten beiden Ziffern wegfallen lassen (also
>> statt 10 nur 8 Ziffern). Geht das mit Bordmitteln (Skripten /nach/ der
>> Ausgabe geht, ist aber suboptimal).
>
> Ich habe hier leider nur MySQL 8.0 zur Hand.
> Damit habe ich jetzt folgendes ausprobiert:
>
> |
> |mysql> USE D
> |Database changed
> |
> |mysql> CREATE TABLE T( F BIGINT );
> |Query OK, 0 rows affected (0.14 sec)
> |
> |mysql> INSERT INTO T( F )VALUES( 123456789 );
> |Query OK, 1 row affected (0.07 sec)
> |
> |mysql> SELECT LEFT(F,LENGTH(F)-2) FROM T;
> |+---------------------+
> || LEFT(F,LENGTH(F)-2) |
> |+---------------------+
> || 1234567 |
> |+---------------------+
> |1 row in set (0.00 sec)
> |
>
> .
>
>
Ah, das sieht schon mal gut aus. Sollte auch mit PSQL gehen .....
--
Cheers,
G.
Quis custodiet ipsos custodes?
---------------------------->8------------------------------
/"\
\ / ASCII Ribbon Campaign
X against HTML e-mail
/ \
---------------------------->8------------------------------
Back to ger.ct | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Postgressql Goetz Schultz <news.expire1225@goetz.co.uk> - 2022-10-02 19:23 +0100
Re: Postgressql Michael Bode <m.g.bode@web.de> - 2022-10-02 20:43 +0200
Re: Postgressql Goetz Schultz <news.expire1225@goetz.co.uk> - 2022-10-02 19:46 +0100
Re: Postgressql Michael Bode <m.g.bode@web.de> - 2022-10-02 20:52 +0200
Re: Postgressql Goetz Schultz <news.expire1225@goetz.co.uk> - 2022-10-02 19:59 +0100
Re: Postgressql Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2022-10-03 08:01 +0000
Re: Postgressql Goetz Schultz <news.expire1225@goetz.co.uk> - 2022-10-03 10:30 +0100
Re: Postgressql Goetz Schultz <news.expire1225@goetz.co.uk> - 2022-10-02 19:44 +0100
Re: Postgressql Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2022-10-03 08:06 +0000
Re: Postgressql Michael Bode <m.g.bode@web.de> - 2022-10-03 10:15 +0200
Re: Postgressql Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2022-10-03 09:57 +0000
Re: Postgressql Michael Bode <m.g.bode@web.de> - 2022-10-03 12:12 +0200
csiph-web