RE: Limit chars from select

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'd like to avoid having to manually add all of the cols to the select
statement if possible, so if there's a universal command I can put in
that'd be best.

Basically most of the fields are short.. 2 cols "action" and "comments"
are text so can be a bit lengthy. The 1st page is a sumary page of a
number of the rows, so what I'm wanting to do is limit the display on
initial sumary page to say 100 chars per field and then if they click on
the row for more info I can then display the full info.

-----Original Message-----
Sent: Monday, January 30, 2006 12:51 PM
To: Gavin Amm; php-db@xxxxxxxxxxxxx
Subject: Re:  Limit chars from select


Gavin Amm wrote:
> How do I limit the characters a Select statement returns?
> In Seudo code:
> SELECT * FROM myTable LIMITCHARS 30;
> 
> I'm using MySQL.
> 
> Thanks.
> 

Do you want to limit the characters from an individual field?  If so,
then

SELECT SUBSTRING(FIELD1 FROM 1 FOR 30) FROM myTable;

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux