Search data from database according to given data using SQL Server -


i want retrieving data database according given data in search field using sql server.i explaining scenario below. suppose have table in database:

t_hospital_clinic:

id     hospital        clinic           location        department ------------------------------------------------------------------ 1      kiims hosp.     kar clinic       bhubaneswar     pediatric. 2      scb medical     aswani clinic    cuttack         ent 3      sum             mishra clinic    bhubaneswar     orthopedic 4      amri            image dignisys   cuttack         neorolgy 5      aiims           mahaveer clinic  bhubaneswar     ent 6      shree hosp      shaoo's clinic   cuttack        pediatric. 

here table name t_hospital_clinic , need putting location / department name inside search field, can access hospital / clinic name.

suppose want check how many hospital / clinics present in bhubaneswar belongs ent department , in case should sql query find out data.

please me write proper query solve problem.

this seems basic sql statement where clause contains 2 conditions on 2 columns joined and:

select hospital, clinic t_hospital_clinic location = @location -- perhaps it's better use here instead , department = @department 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -