pankaj.ghadge Posted August 22, 2008 Share Posted August 22, 2008 My database structure is+----------------------+--------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+----------------------+--------------+------+-----+---------+----------------+| ID | int(11) | NO | PRI | NULL | auto_increment | | UserID | int(11) | YES | | NULL | | | HighestQualification | varchar(30) | YES | | NULL | | | University | varchar(30) | YES | | NULL | | | Skill | varchar(50) | YES | | NULL | | | ExperienceInYear | int(11) | YES | | NULL | | | ExperienceInMonth | int(11) | YES | | NULL | | | Designation | varchar(80) | YES | | NULL | | | SalaryPerYear | int(11) | YES | | NULL | | | ResumePath | varchar(170) | YES | | NULL | | | CreatedOn | date | YES | | NULL | | | CreatedBy | int(11) | YES | | NULL | | | LastEditedOn | date | YES | | NULL | | | LastEditedBy | int(11) | YES | | NULL | | +----------------------+--------------+------+-----+---------+----------------+ I have taken 3 fields as bellow1)keyword : (text box contain values separated by comma like c,c++,java,mca,mcs).2)experience: first textbox is year, second text box month. suppose he enters 11 year 3 month. I want to find the records which has more experience than this.3)location (text box is for location)4)Search buttonplease tell me how to write a query for this.........please Link to comment Share on other sites More sharing options...
smartalco Posted September 2, 2008 Share Posted September 2, 2008 a. for the love of my eyes, put the DB information in a codebox, so it is readable (it preserves tabs/space formatting)b. what you are trying to do would require quite a bit of scripting before and after the query to get to do what you want (either that, or a ridiculously complex query for only using 1 table)steps would be:(before 1: change your experience fields to just 1, and make it months, so then you don't have to keep track of 2 variables, if you want the final output in years, just divide by 12, remainder is months)1. separate each keyword in the keyword field2. try to identify the type of keyword (ie: is the keyword a skill, university), if it can't be identified, leave as is3. convert the years/months fields into just months (years*12 + months)4. create your SQL query5. format/display results Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.