If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Can you tell me what this is called?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-02-12, 23:42
Jsin Jsin is offline
Registered User
 
Join Date: Jan 2012
Posts: 16
Can you tell me what this is called?

I have a list of first names and I need to query all the ones that end in a certain letter. I'm not sure what you would call this so I don't really know what I'm looking for. I would be grateful for any guidance.
Reply With Quote
  #2 (permalink)  
Old 02-02-12, 23:57
Jsin Jsin is offline
Registered User
 
Join Date: Jan 2012
Posts: 16
Nevermind I found what I'm looking for.. I'll use the wildcard

SELECT *
FROM table_name
WHERE fname LIKE '%A';

I'll put it here just in case someone else needs it.

Thanks!
Reply With Quote
  #3 (permalink)  
Old 02-03-12, 00:55
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
Two more options for you:
Code:
where regexp_like(fname, 'A$')

where substr(fname, -1) = 'A'
Reply With Quote
  #4 (permalink)  
Old 02-03-12, 09:35
beilstwh beilstwh is offline
Lead Application Develope
 
Join Date: Jun 2004
Location: Liverpool, NY USA
Posts: 2,222
and of course if the lname ends in a lower case a then

SELECT *
FROM table_name
WHERE upper(fname) LIKE '%A';
__________________
Bill
You do not need a parachute to skydive. You only need a parachute to skydive twice.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On