-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
* and then Nick Wilson declared
> You have an error in your SQL syntax near 'desc FROM news ORDER BY date ' at line 1
Ooops, reserved word! Works great ;-)
Any way to add something to it like "" or should I do that in my
php?
Many thanks g
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
* and then Julie Meloni declared
> Start with position 1.
>
> SELECT datefield, SUBSTRING(textfield, 1, 30) as description FROM
> tablename WHERE id = 2;
Hi again Julie and thanks for 'cross list' help!
The problem is not that, at least not fir
should it not be:
SELECT date, substring(text,1,30) as
string length starts at position "1". substring, therefore, would consider
the first character of the string as position 1, not 0.
- Original Message -
From: "Nick Wilson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thur
On 14 Jun 2002, at 0:03, Nick Wilson wrote:
> SELECT date, SUBSTRING(text, 0,30) as description FROM table WHERE id
> = '2';
You can't assume that MySQL is like Perl, PHP, or any other language
you may be used to. Note this: "For functions that operate on string
positions, the first position
Hi -
NW> I have a table (for example) with three cols 'id' | 'date' | 'text'
NW> I want to return just 'date' and the first 30 chars from 'text'
NW> I've tried this sql:
NW> SELECT date, SUBSTRING(text, 0,30) as description FROM table WHERE id =
NW> '2';
Start with position 1.
SELECT datefi