I want to write a select statement to retrieve a record based on a criterior, input by the user.
can someone please show me how this is written please.
What exactly do you mean by criteria? If I understand you correctly, let's say you have a table with ID and Name and user want to see everything that have ID > 5. If this is the case, then all you need to do is SELECT * FROM tbl_name WHERE ID > 5. now to have this correspond to different user input. you would have your original SQL statement as SELECT * FROM tbl_name WHERE and then extract the text input by user and concat the two string together and execute the SQL Statement.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.