Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

sql get all surname with out A and B

Posted on 2011-04-26
2
Medium Priority
?
392 Views
Last Modified: 2012-05-11
Hi,

I have an sql table which is called customer


i am writing the following query

select Code,
from customer
where surname not like 'A%' or suname not like 'B%'

but it is still returning surnames begining with A and B, what i want is to return surnames that do not start with A or B

Please help

Thanks,

R8VI
0
Comment
Question by:R8VI
2 Comments
 
LVL 4

Accepted Solution

by:
malikirfan28 earned 2000 total points
ID: 35465642
Use the following query

select Code,
from customer
where surname not like 'A%' and suname not like 'B%'

0
 
LVL 4

Expert Comment

by:qasim_md
ID: 35465669
Try this ... let me know if it worked ???

select *
from customer
where upper(surname) not like 'A%' or upper(surname) not like 'B%'
0

Featured Post

Independent Software Vendors: 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

I have a large data set and a SSIS package. How can I load this file in multi threading?
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

578 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