Solved

Syntax for selecting partial row

Posted on 2008-10-16
2
158 Views
Last Modified: 2012-05-05
I'm trying to query a column in my table called invoice.  Which has data like:

123
154
14235
123-old

ect....

I only want to get the ones that have a "-old" on them.  Below is what I'm trying for but the * doesn't work the way I need it to.

select InvoiceNo
from DebtorService
where Invoiceno = *-old
0
Comment
Question by:N R
2 Comments
 
LVL 17

Accepted Solution

by:
Daniel Reynolds earned 500 total points
ID: 22734854
select InvoiceNo
from DebtorService
where Invoiceno LIKE '%-old'
0
 
LVL 11

Author Closing Comment

by:N R
ID: 31506884
Perfect, thanks.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

831 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