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 |
|
aks
Starting Member
28 Posts |
Posted - 2005-03-15 : 12:34:25
|
| Hi, I have a table with following fields: UID INT NAME============================================34 1111 Jan34 1124 200434 67 hr34 1117 JULY34 1124 200434 56 hr56 1111 JAN56 1125 200556 3 hr56 1119 SEPT56 1124 200456 78 hrI'm trying to get the output as JAN in 2005(1125) only not 2004(1124)BUT JULY I want in 2004(1124) LIKE:UID NAME============================34 111734 112434 5656 111156 112556 356 111956 112456 78I used the foolwing query but its giving me NO JAN value neither 2004 nor 2005.select a.uid,b.val_int from hr a, hr b,hr c where a.recordset_id=b.recordset_id anda.recordset_id=c.recordset_idAND((a.val_int=1111and b.val_int=1125) or(a.val_int=1112 and b.val_int=1125)or(a.val_int=1113 and b.val_int=1125) ora.val_int=1114 ora.val_int=1115 ora.val_int=1116 ora.val_int=1117 ora.val_int=1118 ora.val_int=1119 ora.val_int=1120 ora.val_int=1121 ora.val_int=1122 )ANDc.question_id=1123order by a.uid |
|
|
aks
Starting Member
28 Posts |
Posted - 2005-03-15 : 13:27:09
|
| can sombdy please help me??? |
 |
|
|
aks
Starting Member
28 Posts |
Posted - 2005-03-15 : 14:21:58
|
| any help |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-03-15 : 14:26:36
|
well i for one have no idea what exactly you really need.post create table statemnts, sample data in the form of Insert into statements and desired results based on the sample data.that way we can simply copy/paste the data to our QA and run it and test it.Go with the flow & have fun! Else fight the flow |
 |
|
|
aks
Starting Member
28 Posts |
Posted - 2005-03-15 : 14:58:16
|
| In simple words I have columns UID INT=========================2 11112 11242 64 11114 1125 4 94 11174 11244 75 11115 11255 7I want the row with (INT=1111 AND INT=1125) NOT 1124 OUTPUT========4 94 7I hope this will help u. |
 |
|
|
aks
Starting Member
28 Posts |
Posted - 2005-03-15 : 14:58:21
|
| In simple words I have columns UID INT=========================2 11112 11242 64 11114 1125 4 94 11174 11244 75 11115 11255 7I want the row with (INT=1111 AND INT=1125) NOT 1124 OUTPUT========4 94 7I hope this will help u. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-03-15 : 15:04:23
|
well i don't want to be a pain but it doesn't help.because you say you want rows where (INT=1111 AND INT=1125) NOT 1124 but in the results you have INT 9 and 7and that logic is a bit strange to me.Go with the flow & have fun! Else fight the flow |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-03-16 : 01:31:11
|
| I didn't understand it either - I thought it was just me!Kristen |
 |
|
|
|
|
|