Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > MySQL > Query Help Please

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-31-03, 21:26
gandalf gandalf is offline
Registered User
 
Join Date: Jan 2003
Posts: 7
Red face Query Help Please

Hi,

I would appreciate it if someone could shed some light on this problem.

Say I have a table full of TicketNums and I want to find the one shown below.

Ticketnum | Prob_ID | Emp_ID1 | Emp_ID2 |
------------------------------------------------------
105 | 634 | 89 | 677 |


Now, lets say I have 4 Emp_ID's to work with.

EmpID = 89,677,768,898

The EmpID values can exist in either Emp_ID1 or Emp_ID2.


Now I want to setup a query that will go through each EmpID and will get me the result below.

I've figured out how to work this out if I have only two EmpID to start with

query" SELECT * FROM Tickets WHERE Ticketnum=105 &&
( (Emp_ID1='89' || Emp_ID1='677') && (Emp_ID2='89' || Emp_ID2='677') )

This gives me the result below, but if I have more than two EmpID to start with then I'm lost.

Ticketnum | Prob_ID | Emp_ID1 | Emp_ID2 |
------------------------------------------------------
105 | 634 | 89 | 677 |


Any help will be greatly appreciated.

Thanks
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On