Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
a_shipra
Starting Member
20 Posts |
Posted - 2004-08-29 : 22:12:32
|
| hi all,i have 2 tables likeclass id(Pk) class nameAa abc ab sssac awqad skiwae wqwqitem id(PK) class id aa aaab aass abqw acaq adsa aenow my requirement is to pull the data for classes like from aa - ab and ad - aeis this possible in any way? |
|
|
mk_garg20
Constraint Violating Yak Guru
343 Posts |
Posted - 2004-08-29 : 22:15:38
|
| Basically you don't want class ac.Is that corerct?What you want to do?mk_garg |
 |
|
|
a_shipra
Starting Member
20 Posts |
Posted - 2004-08-29 : 22:33:14
|
| no this is just an example.basically i want to skip some classes.suppose it likeaa-acba-cakt-kzlike that no exact sequence. |
 |
|
|
mk_garg20
Constraint Violating Yak Guru
343 Posts |
Posted - 2004-08-30 : 18:40:06
|
| Post your table structure with data & expected results.mk_garg |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-08-31 : 15:16:01
|
well since you want to pull data from classes:select t2.*from item t1 inner join class t2 on (t1.classid = t2.classid)where t1.classId not in ('ab', 'bc', 'cd', 'fr')Go with the flow & have fun! Else fight the flow :) |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-08-31 : 16:11:45
|
| [code]SELECT *FROM ...WHERE classID between 'aa' and 'ab' OR classID between 'ad' and 'ae'[/code]???- Jeff |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-08-31 : 16:20:23
|
| a lot to work with... :)))Go with the flow & have fun! Else fight the flow :) |
 |
|
|
mk_garg20
Constraint Violating Yak Guru
343 Posts |
Posted - 2004-08-31 : 18:22:04
|
| Thanks Dr.I never used between for strings.mk_garg |
 |
|
|
a_shipra
Starting Member
20 Posts |
Posted - 2004-08-31 : 21:31:39
|
| Thanks alot for your help. |
 |
|
|
|
|
|