Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

use filter condition for a particular column in select statement

$
0
0

hi...

i have 3 tables....

1. wn_synset(synset_id decimal, w_num decimal, word varchar(255), ss_type char)

this table contains word List in word column.

2.wn_gloss(synset_id decimal, gloss varchar(255)

this table contains meaning(wn_gloss.gloss) of word List of wn_synset table, related with its synset_id column.

3. wn_antony (synset_id_1 decimal, w_num_1 decimal, synset_id_2  decimal, w_num_2 decimal)

this table contains synset_id and w_num of words of opposit of the meaning (corresponding to synset_id and w_num), listed in the same wn_synset.word

i have  joined the wn_synset and wn_gloss using the following code...

select 		
g.gloss as meaning,
wrd.ss_type as Word_Type,
wrd.word as word
FROM wn_synset as wrd 
JOIN  wn_gloss as g
ON wrd.synset_id = g.synset_id 
where wrd.word= 'good'  order by wrd.ss_type

now i want to join the 3rd table wn_antony to have another column to result having opposit meaning word.

please help, how could i achieve the following code...

select 		

g.gloss as meaning,
wrd.ss_type as Word_Type,
wrd.word as word
(wrd.word as opposit where wrd.synset_id=tblOpposit.synset_id_2 and wrd.w_num= tblOpposit.w_num_2)

FROM wn_synset as wrd 
JOIN  wn_gloss as g
ON wrd.synset_id = g.synset_id 

join wn_antony as tblOpposit
on wrd.synset_id=tblOpposit.synset_id_1 and wrd.w_num= tblOpposit.w_num_1
where wrd.word= 'good'  order by wrd.ss_type

Please help me achieve this.... 

thanks for any repsonse. :-)


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>