homepage Welcome to WebmasterWorld Guest from 54.161.133.166
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
Help getting one return from multiple rows
JohnSka7




msg:4179140
 1:10 pm on Jul 30, 2010 (gmt 0)

I'm trying to get one row returned for a display of a public phone extension and I'm just not seeing something clearly. I want to check directly in my query that if someone has multiple extensions to only get one based on rules:

A person can have up to 3 types

7000 range is for voicemail
3000 range is for direct
5000 is a boss group (rings multiple phones, ie secretary)

A few administrators that have been promoted through the years started with just voicemail, then got a direct extension, then got a boss group, so I have a "worse case" with them that could look like this:

Name|Ext
------|-------
User | 7140
User | 5620
User | 3259

The rules follow:

If someone has a 5000 range, get that one as 'Public Extension' else If they have a 3000, get that one as 'Public Extension' else get 7000 as 'Public Extension'. Is this possible to do directly in the query?

 

LifeinAsia




msg:4179248
 3:38 pm on Jul 30, 2010 (gmt 0)

If they have all 3 (or 2 of the 3), which one has priority?

JohnSka7




msg:4179268
 4:16 pm on Jul 30, 2010 (gmt 0)

The 5000 range number

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