Sunday, February 19, 2012

How to find a record

How to find a record in table without key? How to get specific record in table without key field and displaying on datagrid?

YOu explanation has to be a bit more specific. There is no problem in finfing any values (even if there is no "key" on the column) by just using a query for retrieving the data. I also do not understand what "How to get a specific record without a key filed" means, because if you want to have a specific record, you will have to provide an identifier for extracting / querying the data from the database.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

hello,

you can search with the select statement, e.g.

NUMBER: SELECT * FROM STORES WHERE ZIPCODE = 21512

SELECT * FROM STORES WHERE ZIPCODE IN (12345, 23145, 23456)

SELECT * FROM STORES WHERE ZIPCODE BETWEEN 21431 AND 21531

TEXT: SELECT * FROM BOOKS WHERE DESCRIPTION = 'COOKING GUIDE'

SELECT * FROM BOOKS WHERE DESCRIPTION LIKE '%COOKING%'

DATE: SELECT * FROM SALES WHERE DATESOLD BETWEEN '2006-01-01' AND '2006-01-02'

SELECT * FROM SALES WHERE DATESOLD >= '2006-01-01' AND DATESOLD < '2006-01-02'

As you can see it depends on the type of data you are looking and on which tables you have to combine to gather the data

More info (tables involved, columns) and the report you are trying to make would help

(I believe this is a T-SQL topic though)

No comments:

Post a Comment