473,322 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

The MySQL command LEFT() counterpart in PostgreSQL?

Paks
13
Hello,
I have a quick little question about the MySQL-command LEFT(columnName,int).
My question is if there's a counterpart in PostgreSQL for this command and what it is?

What I want to do is take the first specified amount of signs in a text-column and print them out.
For example:

Instead of printing out all information in a text-column...
SELECT story FROM table01;
Once upon a time in a land far far away lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec eget libero eget pede rutrum iaculis.

I want to be able to specify the number of signs printed...
SELECT LEFT(story, 20) FROM table01; // this is the MySQL-cmd "LEFT"
Once upon a time in

Is this possible to do in PostgreSQL? And what is the command for it in that case?

I'm a total newb when it comes to PostgreSQL and my earlier knowledge of MySQL is limited, unfortunately :/

So I would be thankful for any help.

//Paks
Dec 4 '06 #1
2 6753
michaelb
534 Expert 512MB
I think this should work for you:
Expand|Select|Wrap|Line Numbers
  1. SELECT  substring(story, 1, 20)  FROM  table01;
Dec 5 '06 #2
Paks
13
Thanks Michelb, it worked :)
Dec 12 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
33
by: Joshua D. Drake | last post by:
Hello, I think the below just about says it all: http://www.commandprompt.com/images/mammoth_versus_dolphin_500.jpg Sincerely, Joshua Drake
74
by: John Wells | last post by:
Yes, I know you've seen the above subject before, so please be gentle with the flamethrowers. I'm preparing to enter a discussion with management at my company regarding going forward as either...
12
by: Martin_Hurst | last post by:
It would appear that MySQL is making great strides into the commercial and even the enterprise arena. I am not seeing the same news coverage being said about Postgresql. I believe Postgresql has...
175
by: Sai Hertz And Control Systems | last post by:
Dear all, Their was a huge rore about MySQL recently for something in java functions now theirs one more http://www.mysql.com/doc/en/News-5.0.x.html Does this concern anyone. What I...
0
by: Chris Ochs | last post by:
Not to change the topic too much, but as a new postgresql user I have to say that it takes quite a bit of time to find even the basic postgresql tools/interfaces/etc that are available. The main...
67
by: Bob Powell | last post by:
To whom it may concern: I find the recent articles in various trade publications a little disturbing due to the lack of PostgrSQL mention. I continue to see articles about how IBM may be...
1
by: Richard Huxton | last post by:
On Thursday 12 February 2004 20:25, Prashanthi Muthyala wrote: > Hi Richard Hi Prashanthi - nice to hear from you again. I've taken the liberty of cc-ing the general list on this, since there...
34
by: Karam Chand | last post by:
Hello I have been working with Access and MySQL for pretty long time. Very simple and able to perform their jobs. I dont need to start a flame anymore :) I have to work with PGSQL for my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.