Skip to Content
0
Former Member
Sep 10, 2007 at 05:44 PM

select query doubt

22 Views

Hi I have a situation where in a table has following fields

Id

username

status

userdetails

and the id, user name, status fields are key fields.

in the select query even if I pass a single key(not all three) I should get the user details how can i write the query?

(ie sometimes status will be unique and table will have only a single entry with that status) Do i need to use AND in the where clause to achieve this?

SELECT SINGLE * from table where id = id

and username = username

and status = status.

my question is if table has an enry id=1000 username = 'anne' status = 'manager'

and is i pass only the status to query it should retrieve the record..

Will this query work

thanks in advance.