Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    4

    Lightbulb Unanswered: MySql query please help me

    Hi
    I am a newbie to MySql, I learnt that it does not support sub selects, I have a problem

    I have primary keys like this

    JA.01.01
    JA.01.02
    JA.01.03
    JA.02.01
    JA.02.02

    what i want is i want to get (unique ones)

    JA.01.XX
    JA.02.XX
    JA.03.XX

    as results.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    select distinct concat_ws('.',left(pkey,5),'XX') from yourtable
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2004
    Posts
    4

    Thanks

    Originally posted by r937
    select distinct concat_ws('.',left(pkey,5),'XX') from yourtable

    Hi it worked thanks for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •