homepage Welcome to WebmasterWorld Guest from 54.234.228.64
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
Skipping a row, whilst sorting a table
londrum




msg:4179661
 8:53 am on Jul 31, 2010 (gmt 0)

i'm guessing that this is probably impossible, but im hoping someone brainy knows how to do it...

i've got a page which displays a table of data, which is sorted by date. so far, so easy.

but when it comes to two rows in particular, i need them to appear as if they were the next row down. so when the script prints all the rows out, i need to skip over them for just one row, and print them after the next one.

is that possible?

 

rocknbil




msg:4179809
 4:28 pm on Jul 31, 2010 (gmt 0)

Me gotz nuttin' . . . in mySQL anyway.

What are the "identifying factors" of these rows? Are they a series of conditions you can pick up via programmimg without hard coding them?

LifeinAsia




msg:4180645
 3:45 pm on Aug 2, 2010 (gmt 0)

Can you provide some example data? Will it always be those 2 rows, or rows meeting certain conditions?

londrum




msg:4180694
 5:19 pm on Aug 2, 2010 (gmt 0)

i think i've resigned myself to adding a new column.
but this is what the problem is...

it's a database of songs. and i can sort them alphabetically and by release date, because they're the only columns i've got.

when i sort them by release date, and two songs share the same date (because they are the A and B-side of a single) i naturally want to list the A-side first. but at the moment i can only list them alphabtically, which is wrong about 50% of the time.

so i was hoping i could get it to skip a row every time a certain song title came up.

LifeinAsia




msg:4180702
 5:41 pm on Aug 2, 2010 (gmt 0)

Yes, I would add another field and do a secondary ORDER on that field.

enigma1




msg:4187050
 3:30 pm on Aug 14, 2010 (gmt 0)

or you could expand the date col to be datetime and then set the secs for instance to force ordering without an additional col.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved