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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Means to Filter Result Sets

Author  Topic 

Plotin
Starting Member

21 Posts

Posted - 2004-03-07 : 16:56:30
Hi Out There

I want to receive a result set which satisfies the following conditions


*********************************************************************
* General Info
* All conditions are refering to one field within a Table
* The field of the table tabX is called FieldName and stores * information about textboxes on a form as varchar *
*********************************************************************


Show me all records from tabx having FieldName = 'FirstFieldName'
From this result set show me all records having FieldName = 'SecondFieldName'
From this result set show me all records having FieldName = 'ThirdFieldName'

General Spoken:
From result set n show me all records having table field NAMEOFTHEFIELD = Condition a


Question: Can this be accomplished by using a Select query including Where, Group By, and Having clauses?????
If so: How must this query be composed????

OR
: Does it require the use of a Cursor????

sachinsamuel
Constraint Violating Yak Guru

383 Posts

Posted - 2004-03-07 : 17:50:40
Y don't u try, table datatype? Please check BOL for more information.

Sachin
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-03-07 : 19:04:28
Show me all records from tabx having FieldName = 'FirstFieldName'
From this result set show me all records having FieldName = 'SecondFieldName'

i.e FieldName = 'FirstFieldName' and FieldName = 'SecondFieldName'
empty resultset or am I missing something.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -