www.webdeveloper.com
Results 1 to 5 of 5

Thread: Need help in using LIKE

  1. #1
    Join Date
    Oct 2011
    Posts
    350

    Need help in using LIKE

    Hi..


    I have 2 tables with Cloth column.

    sales_order table
    Cloth -column

    sample data of Cloth

    3392
    3520
    3392 Yellow/White
    3392 BLUE
    3392 RED
    3392 Orange

    cloth_parameter - table
    Cloth -column

    sample Cloth
    3392N
    3520
    3392Yellow/White
    3392 Blue
    3392 Red
    3392Orange

    How can I equal the two data eventhough the format of data has difference using like.

    Thank you

  2. #2
    Join Date
    Jul 2011
    Posts
    131
    If you want to select rows where column Cloth from both tables matches the same pattern you can use next query:
    Code:
    SELECT * FROM `sales_order` AS `so`, `cloth_paramenter` AS `cp`
    WHERE `so`.`Cloth` LIKE '3392%' AND `cp`.`Cloth` LIKE '3392%'

  3. #3
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    You should really normalize the data using keys.

  4. #4
    Join Date
    Oct 2011
    Posts
    350
    Quote Originally Posted by yamaharuss View Post
    You should really normalize the data using keys.
    What do you mean keys??

    Thank you

  5. #5
    Join Date
    Oct 2009
    Posts
    658

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles