Unix Technical Forum

1st letter querry

This is a discussion on 1st letter querry within the MySQL forums, part of the Database Server Software category; --> Hi There is posible tu get just 1st letter From database row using just one querry And Letter shouldn't ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:05 AM
Sebastian
 
Posts: n/a
Default 1st letter querry

Hi

There is posible tu get just 1st letter From database row using just
one querry And Letter shouldn't be repleaced

For example

Table name: Company

column name: companyName

Values

Albha
Apple
Beta
Delta
Dinosour
Gama

In result of querry i need have:

A
B
D
G

Best Regards
Sebastian Haja

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:05 AM
Captain Paralytic
 
Posts: n/a
Default Re: 1st letter querry

On 22 Jun, 11:31, Sebastian <haja.sebast...@gmail.com> wrote:
> Hi
>
> There is posible tu get just 1st letter From database row using just
> one querry And Letter shouldn't be repleaced
>
> For example
>
> Table name: Company
>
> column name: companyName
>
> Values
>
> Albha
> Apple
> Beta
> Delta
> Dinosour
> Gama
>
> In result of querry i need have:
>
> A
> B
> D
> G
>
> Best Regards
> Sebastian Haja


SELECT
LEFT(`companyName`,1)
FROM `Company`

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 11:05 AM
sandee.goyal04@gmail.com
 
Posts: n/a
Default Re: 1st letter querry

On Jun 22, 3:31 pm, Sebastian <haja.sebast...@gmail.com> wrote:
> Hi
>
> There is posible tu get just 1st letter From database row using just
> one querry And Letter shouldn't be repleaced
>
> For example
>
> Table name: Company
>
> column name: companyName
>
> Values
>
> Albha
> Apple
> Beta
> Delta
> Dinosour
> Gama
>
> In result of querry i need have:
>
> A
> B
> D
> G
>
> Best Regards
> Sebastian Haja


SELECT DISTINCT LEFT(`companyName`,1)
FROM `Company`

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 11:05 AM
sandee.goyal04@gmail.com
 
Posts: n/a
Default Re: 1st letter querry

On Jun 22, 3:31 pm, Sebastian <haja.sebast...@gmail.com> wrote:
> Hi
>
> There is posible tu get just 1st letter From database row using just
> one querry And Letter shouldn't be repleaced
>
> For example
>
> Table name: Company
>
> column name: companyName
>
> Values
>
> Albha
> Apple
> Beta
> Delta
> Dinosour
> Gama
>
> In result of querry i need have:
>
> A
> B
> D
> G
>
> Best Regards
> Sebastian Haja


SELECT distinct
LEFT(`companyName`,1)
FROM `Company`

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 11:05 AM
Good Man
 
Posts: n/a
Default Re: 1st letter querry

sandee.goyal04@gmail.com wrote in news:1182520180.626097.230430
@o11g2000prd.googlegroups.com:

> On Jun 22, 3:31 pm, Sebastian <haja.sebast...@gmail.com> wrote:
>> Hi
>>
>> There is posible tu get just 1st letter From database row using just
>> one querry And Letter shouldn't be repleaced
>>
>> For example
>>
>> Table name: Company
>>
>> column name: companyName
>>
>> Values
>>
>> Albha
>> Apple
>> Beta
>> Delta
>> Dinosour
>> Gama
>>
>> In result of querry i need have:
>>
>> A
>> B
>> D
>> G

>
> SELECT distinct
> LEFT(`companyName`,1)
> FROM `Company`

ORDER BY companyName


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:43 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com