Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to select * from tableA where columnA values don't start with letter 'F'

Tags:

sql

Can I have a SQL query to get the data from columna in tableA whose values don't start with 'f' ?

For example:

select * from  tableA where columnA

where values don't start with letter 'F'.

like image 718
subash Avatar asked May 20 '10 04:05

subash


People also ask

How do I exclude a special character in SQL query?

In some situations, we may not want a space or another special character, so we can include the special character that we want to exclude in our not regular expression, such as [^A-Z0-9 ] to exclude a space.

How do I select a column to exclude?

To exclude columns, you use the REPLACE() and GROUP_CONCAT() functions to generate the column names you wish to include in your SELECT statement later. You can use the result to create your SELECT statement: SELECT address,age,email,id,name,phone FROM Students; And that's how you use the information_schema.

How do I select different column values in SQL?

The SQL SELECT DISTINCT Statement The SELECT DISTINCT statement is used to return only distinct (different) values. Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values.


1 Answers

For a MSSQL Scenario, you should be able to use the "NOT" operator in conjunction with the LIKE operator. So your SQL would look roughly like

select * from tableA where columnA NOT LIKE 'F%'

like image 52
Greg Olmstead Avatar answered Nov 01 '22 01:11

Greg Olmstead