Jump to content

Archived

This topic is now archived and is closed to further replies.

budman

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

Recommended Posts

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)

Share this post


Link to post
Share on other sites
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 ;)

Share this post


Link to post
Share on other sites
THANKS!!!  YOU ROCK!!!

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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.