Search string Records

Hello
I would like to ask for help. I do not know how to write a query to a database that records marked I like the file shown http://www.panorama.vot.pl/table.jpg. I want to search for a string of records in col1 from col2 (highlight it wants and how it does not find that the lack of communication drew within. Number of records in col2 will increase or decrease. Thanks in advance for any answers.

Please paste your table structure on here in plain text so that everyone can read it in case you take that image down, plus I don’t want to open that while at work.

I want to search for a string of records in col1 from col2 (highlight it wants and how it does not find that the lack of communication drew within. Number of records in col2 will increase or decrease. Thanks in advance for any answers.

So there is no “highlighting” in SQL. I’m also at a loss when trying to figure out what you want your final result to be out of that recordset.

I want find records from col2 in the same order in col1 . You can see that on picture http://www.panorama.vot.pl/table.jpg

So you want your end result to be
col1

1
2
3
4
5
1
2
3
4
5

yes, and will it possible in which id (of course if I have id column)

id col1

1 1
2 2
3 3
4 4
5 5
16 1
17 2
18 3
19 4
20 5

So what is your query for

col1

1
2
3
4
5
1
2
3
4
5

I don’t have one yet. Not sure I’ve seen one like this before. What sql server are you using? Also how large of a table are we talking about?

I’m usigng MySQL server and table have one column with 2000 records and second column with flexible records (5-10).

could you please run this query and post the results –

SHOW CREATE TABLE [I]tablename[/I]

where tablename is the name of your table

CREATE TABLE klikacz (
id int(50) NOT NULL AUTO_INCREMENT,
col1 varchar(50) CHARACTER SET latin2 NOT NULL,
col2 varchar(50) CHARACTER SET latin2 NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM AUTO_INCREMENT=100 DEFAULT CHARSET=utf8

i do not understand this

i don’t understand this, either