Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COnverting Ints from other tables

Status
Not open for further replies.

sharvey99

Programmer
Aug 24, 2000
16
GB
Can anyone help as I'm a bit of an SQL duffer...

I have a table 'table1' that contains 2 fields

type int,
summary varchar(255)

Values

'21' 'This is an SNMP Trap'

Each value for type has a text conversion in 'table2'

type_text varchar(16),
type_int int

'SNMPTrap' '21'

Is there a method of displaying the Int value in table1 using the text equiv. from table2 during a sinlge select
statement?

In short I would like to see...

type: summary:
'SNMPTrap' 'This is an SNMP Trap event'

when I do a query instead of

type: Summary:
'21' 'This is an SNMP Trap event'

I hope this is clear
Many Thanks in advance



 
A JOIN query like the following should give what you need.

Select b.Type_Text, a.Summary
From table1 As a
Job table2 As b
On a.Type=b.Type_int Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top