Solved

MySQL : How to only select certain data from the table?

Posted on 2012-04-03
2
254 Views
Last Modified: 2012-04-03
Hie All,

How do I only select a certain results from the table using MySQL queries?

Eg: I have a table below.

+-----------+
| data |
+-----------+
|      BM |
|      BI  |
|      MM |
|      SJ  |
|      GE |
|      PJ  |
+-----------+

How do I only select all the data except 'PJ' ?

Thanks.
0
Comment
Question by:bosscat
2 Comments
 
LVL 17

Accepted Solution

by:
sonawanekiran earned 400 total points
ID: 37800098
Try like this
SELECT * from your_table_name where  data != "PJ"
0
 
LVL 1

Author Comment

by:bosscat
ID: 37800116
Awesome! it works. thanks alot and the prompt response.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question