Re: How to optimize ugly order by?

2004-03-24 Thread Dave Dash
Can you do: SELECT IF(membershiptype = 0, 3, membershiptype) AS s1 FROM... ORDER BY s1 Shouldn't that work? Basically if mtype is 0 return 3 otherwise return the membership type... and sort by that field. lemme know if that works or if I'm dead wrong ;) Henrik Schröder wrote: Hi all,

Re: Selecting non opposites

2004-03-22 Thread Dave Dash
Yeah, I want to avoid code if possible, some ideas was marking adjectives with a class tag, and doing a group by class so only one item in any given class would appera e.g. good and evil would have the same class or male and female would have the same class. this, however, requires me to enter

Selecting non opposites

2004-03-22 Thread Dave Dash
I have a table of adjectives: ++ | word | ++ | green | | ugly | | dark | | evil | | female | | male | | drunk | ++ and I want to select three of them randomly, but I don't want female and male to accidentally appear together (since they are opposites). I can't

Query pages by Alphabet

2003-09-09 Thread Dave Dash
I have a page that is a directory of names ordered by lastname, firstname (e.g. SELECT fn, ln FROM directory ORDER BY ln, fn LIMIT 0,10). I have it paginated so that there are 10 results per page. What I'd like to do instead of having page numbers (which can be unhelpful when trying to page t