Click here to Skip to main content

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrasing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pinmembermark merrens3-Oct-12 6:43 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data PinprotectorAspDotNetDev3-Oct-12 6:45 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pinmembermark merrens3-Oct-12 7:02 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pinmemberasdrog3-Oct-12 13:21 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data PinmemberSentenryu4-Oct-12 0:50 
GeneralRe: Infinate levels of hierarchal data PinmemberBernhard Hiller4-Oct-12 0:28 
GeneralRe: Infinate levels of hierarchal data Pinmemberasdrog4-Oct-12 11:35 
GeneralRe: Infinate levels of hierarchal data PinprotectorAspDotNetDev4-Oct-12 12:24 
You may be interested in another way of doing hierarchical data in a table. It looks a bit like this:
IdParentIdIdPathWhateverData
1NULL1Blah
211_2Blah
311_3Blah
4NULL4Blah
521_2_5Blah
651_2_5_6Blah
If you include the full path of ID's (the ID and all ancestor ID's), you can reduce the number of queries required to get all descendents of a record. I think newer versions of SQL Server have some ability to query hierarchical data, but this approach will work on all SQL systems.

GeneralRe: Infinate levels of hierarchal data Pinmemberasdrog4-Oct-12 13:20 
GeneralCSS selector of the day PinadminChris Maunder2-Oct-12 8:41 
GeneralRe: CSS selector of the day PinmemberZac Greve2-Oct-12 9:32 
GeneralRe: CSS selector of the day PinmemberMike Ortmans2-Oct-12 22:38 
GeneralRe: CSS selector of the day PinmemberBobJanova2-Oct-12 23:31 
GeneralRe: CSS selector of the day PinadminChris Maunder3-Oct-12 4:19 
JokeRe: CSS selector of the day PinmemberMarcus Kramer3-Oct-12 4:23 
GeneralRe: CSS selector of the day PinmemberSentenryu3-Oct-12 1:11 
GeneralRe: CSS selector of the day PinmemberYvan Rodrigues3-Oct-12 3:55 
GeneralRe: CSS selector of the day Pinmemberjayson lorenzen3-Oct-12 5:03 
GeneralRe: CSS selector of the day PinmemberCésar de Souza3-Oct-12 5:13 
GeneralRe: CSS selector of the day PinadminChris Maunder3-Oct-12 8:20 
GeneralRe: CSS selector of the day Pinmemberjsc4211-Oct-12 0:43 
GeneralRe: CSS selector of the day PinadminChris Maunder11-Oct-12 4:34 
GeneralCoded insults Pinmemberdojohansen28-Sep-12 4:14 
GeneralRe: Coded insults PinmemberMike Winiberg30-Sep-12 20:29 
AnswerRe: Coded insults PinmemberMark Springsteen30-Sep-12 21:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 23 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid