Solved

Sql Query Ambiguous column

Posted on 2013-12-19
3
557 Views
Last Modified: 2013-12-19
I would do a filter in description column, but an error is returned:

Ambiguous column name 'description '.

How can solve.

select  ObrEq.mat, COALESCE(mar.name,obreq.descrip) as description
from obreq
left join Mar on ObrEq.IdMar=mar.IdMar
 where description like '%xxx%'

Open in new window

0
Comment
Question by:rflorencio
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
awking00 earned 500 total points
Comment Utility
where COALESCE(mar.name,obreq.descrip) like '%xxx%'
0
 

Author Closing Comment

by:rflorencio
Comment Utility
Thanks awking00
0
 
LVL 31

Expert Comment

by:awking00
Comment Utility
You're most welcome.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

744 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now