triplell89
Registered User.
- Local time
- Today, 07:49
- Joined
- May 21, 2009
- Messages
- 21
Here is my sql:
I've played with this for a while now, and I can't get it to do what I want.
I have a column that I want to compare to itself. So Profiles in engine and profiles in engine_1 are the same table. Left1 is the first word in the column.
My output looks like this
football field-football-item1
football field-football-item2
football field-football-item3
football field-football-item4
football field-football-item5
football field-football-item6
football field-football-item7
football field-football-football field
football field-football-football shoes
in other words, it displays columns 1 and 2 right, but I want the third column to only show the bold rows. Currently its listing everything in the list.
My psuedo code would be:
If column 3 contains column 2 then
column 1 is original
column 2 is first word
column 3 is matching columns
end if
can someone please help?
Code:
SELECT Distinct [Profiles in Engine].NAME, Left([profiles in engine].[name],InStr([profiles in engine].[name]," ")) AS Left1, [Profiles in Engine_1].NAME
FROM [Profiles in Engine] AS [Profiles in Engine_1], [Profiles in Engine] INNER JOIN Sender_SRTs ON [Profiles in Engine].NAME = Sender_SRTs.SNDR_TP_NAME
WHERE ((([Profiles in Engine].NAME) Like "*[left1]*") AND ((Left([profiles in engine].[name],InStr([profiles in engine].[name]," ")))<>"") AND (([Profiles in Engine_1].NAME) Like "*[left1]*") AND ((Sender_SRTs.[SUM(MSG_CNT)])>10000));
I've played with this for a while now, and I can't get it to do what I want.
I have a column that I want to compare to itself. So Profiles in engine and profiles in engine_1 are the same table. Left1 is the first word in the column.
My output looks like this
football field-football-item1
football field-football-item2
football field-football-item3
football field-football-item4
football field-football-item5
football field-football-item6
football field-football-item7
football field-football-football field
football field-football-football shoes
in other words, it displays columns 1 and 2 right, but I want the third column to only show the bold rows. Currently its listing everything in the list.
My psuedo code would be:
If column 3 contains column 2 then
column 1 is original
column 2 is first word
column 3 is matching columns
end if
can someone please help?