I'm starting to learn SQL. Im using SQL Server Management Studio to write my queries in. I unserstand that I can filter a field contaning a given value (for example : product A, product A (cost), product B, product B (cost)) so in this instance I can filter out values containing "(cost)". I've arrived at the following query but its failing. Can you tell me why.
SELECT billing_code, billing_code_desc
FROM dbo.jm_billing_code
WHERE (NOT (billing_code_desc = N'CONTAIN [(cost)]'))
ORDER BY billing_code
N'CONTAIN [(cost)]' is a string literal, you can't place functions like contain in there.
Try this instead:
where billing_code_desc not like '%(cost)%'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With