Complex SQL Statement 
Author Message
 Complex SQL Statement

I need to extract from a table the words that *Start* with
specific letters - more than one.  i.e. select all those words
that start with B or D or F.

I'm sure there is a way but I can't seem to find a reference for
it. Something has to go in the place I have marked below with
***, but I'm stumped here.  Can anyone redirect me or tell me
what I am doing wrong?

SELECT FirstName, LastName FROM People Where LastName  ***LIKE A
or B or C ****    ORDER BY FirstName"

Thanks for your help.

Scott



Fri, 08 Oct 2004 19:36:30 GMT  
 Complex SQL Statement

Quote:

> I need to extract from a table the words that *Start* with
> specific letters - more than one.  i.e. select all those words
> that start with B or D or F.

[snip]

Quote:
> SELECT FirstName, LastName FROM People Where LastName  ***LIKE A
> or B or C ****    ORDER BY FirstName"

SELECT FirstName, LastName FROM People Where LastName  LIKE 'A%'
OR LastName LIKE 'B%'
OR LastName LIKE 'C%'

ORDER BY FirstName

That should work.
Ive tested the sql statement on an oracle 8.0.5 and got all names starting
with A or B

Greetings from germany
Dirk



Fri, 08 Oct 2004 20:15:37 GMT  
 Complex SQL Statement
what about the C?!

Quote:


>> I need to extract from a table the words that *Start* with
>> specific letters - more than one.  i.e. select all those words
>> that start with B or D or F.

>[snip]

>> SELECT FirstName, LastName FROM People Where LastName  ***LIKE A
>> or B or C ****    ORDER BY FirstName"

>SELECT FirstName, LastName FROM People Where LastName  LIKE 'A%'
>OR LastName LIKE 'B%'
>OR LastName LIKE 'C%'

>ORDER BY FirstName

>That should work.
>Ive tested the sql statement on an oracle 8.0.5 and got all names starting
>with A or B

>Greetings from germany
>Dirk

octinomos
--
Esoterick: http://www.nyx.net/~dlongori/strck.htm.

In fact, two banks located in Bahrain and Kuwait, The Faysal Islamic Bank
and the Kuwait Finance House, which had been listed in European reports as
having terrorist ties were glaringly omitted from George W Bush's financial
crackdown after September 11th. [Source: The Inner City Press, 9-11-99.]
Both banks have correspondent relationships with Deutschebank. --FTW.



Mon, 03 Jan 2005 03:00:15 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help with complex SQL statement

2. Complex SQL statement

3. Help needed - ODBC & complex SQL Statement

4. Saving with Complex SQL statement

5. Long and complex if statement

6. Complex If Statements

7. running sql code record by record instead of statement by statement

8. Complex String Manipulation - Well Complex For Me Anyway

9. SQL's with complex queries

10. SQL Parsing to Complex

11. SQL declaration too complex?

12. complex SQL query

 

 
Powered by phpBB® Forum Software