By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,373 Members | 1,286 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,373 IT Pros & Developers. It's quick & easy.

Search and Joining Fields

P: 1

I'm new to SQL and been trying different queries on a test database. I have been having issues with a join command.

In my DB there are several tables from our current help desk ticketing system. Currently I'm only interested in 2 tables.

The first table is Queues which holds all info for different Queues in the system.
ID, Name, etc.

The second table is Tickets which holds different ticket information.
ID, TicketNo, Queue, Subject, Owner, Status and Priority.

In the Tickets Table under the field Queue is a number representing the queue the ticket is in. ex. 5 = Escalation, 3 = IT, 4 = Approvals, etc.

Within the Queues Table, the ID is the PK which would supply the name to the Queue.

When I do searches I end up with this:

ID TicketNo, Queue, Subject, Owner, Status, Priority
22 1405 3 Help John Open 3

I want to have the Field Queue actually display IT or it's relative name assigned to the number. Example

ID TicketNo, Queue, Subject, Owner, Status, Priority
22 1405 IT Help John Open 3

Any help would be appreciated.

Dec 28 '10 #1
Share this Question
Share on Google+
1 Reply

code green
Expert 100+
P: 1,726
You need to JOIN to queue on ID but select Name instead of ID
Dec 29 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.