![]() |
Sql Select
Hello
How do you querry and find records where specific characters are present in the string in a specific column. I did not find a better place to post this question so here it is: I have a column (FirstColumn) in my table with string values such as: D2-L4-X1 D3-L4-X4 D9-L8-X9 SELECT * FROM tblListing WHERE FirstColumn = 'L4' would not work. I tried LIKE that did not work either. How would you do this querry? Thanks a million in advance. |
Re: Sql Select
Did you try this: here
WHERE substring(FirstColumn,0,2) = 'L4' or this depending on the implenmentation of SQL WHERE substr(FirstColumn,0,2) = 'L4' |
Re: Sql Select
did you try something like
SELECT * FROM tlbListing WHERE FirstColumn LIKE '%F4%'? |
Re: Sql Select
Wouldn't you be better off here with two tables? tblListing can link to another table which contains the same ID and multiple FirstColumns.
:
tblListing:Then you can do this: :
SELECT tblListing.* FROM tblListing, tblFirstColumn WHERE tblListing.ID = tblFirstColumn.ID AND tblFirstColumn.FirstColumnPart = 'L4' |
Thank you guys
Thank you guys I tried all your suggestions and each one worked.
Coffee shuld be on me! |
| All times are GMT -5. The time now is 4:04 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC