Jump to content


Photo

Need query to pull items that are ALL CAPS -> FRED, not Fred


  • Please log in to reply
2 replies to this topic

#1 budman

budman
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 September 2006 - 10:34 PM

I need a query to return item in Hotels_name that is ALL uppercase.

Here is my attempt...

mysql> select hotels_name,hotels_name REGEXP '[[:upper:]]' is_upper from hotels having is_upper=1 limit 10;

+------------------------------------------------------+----------+

| hotels_name                                          | is_upper |

+------------------------------------------------------+----------+

|  Delfin Siesta Mar                                  |        1 |

|  Fairfield Bay Resort                                |        1 |

|  Holiday Inn Express Modesto                        |        1 |

|  Hotel Baronka Bratislava                            |        1 |

|  Resortquest Trappeurs S Crossing                    |        1 |

|  Roof at Spanish Steps Hotel                        |        1 |

|  Waldhotel Eskeshof                                  |        1 |

|  Westbury Mayfair                                    |        1 |

|  YWCA Montreal                                      |        1 |

| "Stirling Country House" Fine Mountain Accommodation |        1 |

+------------------------------------------------------+----------+

10 rows in set (0.00 sec)



#2 thioz

thioz
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 06 September 2006 - 10:45 PM

maybe a too simple solution... if there is such a thing ;)

select hotels_name, from hotels WHERE UPPER(hotel_name) LIKE BINARY hotel_name;

I'm sure it's not the best solution ... but works like a glove .

Have phun ;)

#3 budman

budman
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 September 2006 - 11:45 PM

THANKS!!!  YOU ROCK!!!

Still, the simplest things in life are usually the hardest to see....




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users