Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I like UnderMine's idea, but this only works assuming that there's no double last name with a space between them in the database. If, for example, you have a weird name like "John de Clerk", then the "de"-bit would be regarded as a part of the first name.

Even worse, when someone has a name like "Sandra Meier Schenk". With Swiss people, this could very well occur, with "Sandra" being the first name, "Meier" being the woman's maiden, and "Schenk" the last name of her husband. According to Swiss law, this is perfectly possible and these days even quite frequent. (I won't go into the possible weird situations to which that might lead, let your own imagination run wild.... :-)

Now, I don't know what you intend to do with the data once you've extracted it. If it's just about sorting the stuff, then this might do.

If, however, you want to do something more with the data, even if it's at a later stage, then the only way to go is to re-structure your database. This helps you with your immediate problem, and also puts your data in a form which, should a similar need turn up again, makes the problem much easier. To achieve this, apart from doing it by hand (which is hardly ever an option, unless you only have five entries), the afore-mentioned Lingua::EN::NameParse is probably best.

--cs

There are nights when the wolves are silent and only the moon howls. - George Carlin


In reply to Re: MySQL Alphabetical order with DBI by schumi
in thread MySQL Alphabetical order with DBI by perleager

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2022-05-25 09:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (90 votes). Check out past polls.

    Notices?