View Full Version : sql query for getting limited characters from record which is store in perticular col

11-14-2011, 07:05 AM
I have table gameinfo in that gamedesc column is there , in that column ,game description is there. So i want to display limited characters from that game description.
which query i have to use for that? can anyone help me for this?

Old Pedant
11-14-2011, 09:12 AM
It's usually better to do this in PHP/ASP/JSP code.

Reason: You usually want to "cut" the text on a space and then add "..." to indicate there is more.

But if you really want to do it in MySQL (or Access, or SQL Server), you can just do

SELECT LEFT(somefield,99) AS partialText, other, fields
FROM table

Change 99 to however many characters you want.

11-14-2011, 09:58 AM
it works. thank you very much.