Hi i have a table as below with two column, 1.CODE, 2.Description
Code Description
DRU0001 ABCM
DRU0002 ABCM
DRU0003 ABCM
DRU0004 ABCM
DRU0005 ABVD
DRU0006 ABVD
DRU0007 ABVD
DRU0008 ABVD
DRU0009 AC
DRU0010 AC
DRU0011 ACE (1 day)
DRU0012 ACE (1 day)
DRU0013 ACE (1 day)
DRU0014 ACE (3 day) IV
DRU0015 ACE (3 day) IV
DRU0016 ACE (3 day) IV
DRU0017 ACE (3 day) IV
What I want IS A SQL CODE that will list me the all the rows which has the description ‘ABCM’
select code, Description from Tables.Tables_OD8 WHERE Description ='ABCM'
But the above sql only displays one row and not all the 4 rows that has the description ‘ABCM’
Code Description
DRU0001 ABCM
DRU0002 ABCM
DRU0003 ABCM
DRU0004 ABCM
Any help much appriciated
thanks in advance
Your SQL is correct for the task that you are trying to perform, so the likely culprit is your data: other descriptions probably contain trailing blanks.
To verify, run this query:
This assumes an RDBMS with
+used for concatenation; some DBs use||instead of a+To work around this, use