Hi, my database has 4 colums: name, adres phone and fax
I'm running this query:
SELECT DISTINCT '$sender',MSG = substring ((SELECT RTRIM(name)+',' +RTRIM(street)+ ' t:'+RTRIM(telno )+' f:'+RTRIM(faxno )+' - ' FROM autodatabase WHERE
name LIKE '$keyword%' FOR XML path(''), ELEMENTS),0 ,500) FROM
autodatabase
I want the first reply to be the first 2 rows of what has been found.
I get all the rows with the same keyword in the database.
I've run:
SELECT RTRIM(name)+',' +RTRIM(street)+ ' t:'+RTRIM(telno ) AS search
FROM autodatabase
WHERE name LIKE '$keyword%'
But now it doesn't break the rows. It displays it as one long sentence
How can I break the rows but get 2 rows when asking for data en which string do I use to ask for the next rows (row 3 +4) with the same keyword?
Thanks
Priscillamuis
I'm running this query:
SELECT DISTINCT '$sender',MSG = substring ((SELECT RTRIM(name)+',' +RTRIM(street)+ ' t:'+RTRIM(telno )+' f:'+RTRIM(faxno )+' - ' FROM autodatabase WHERE
name LIKE '$keyword%' FOR XML path(''), ELEMENTS),0 ,500) FROM
autodatabase
I want the first reply to be the first 2 rows of what has been found.
I get all the rows with the same keyword in the database.
I've run:
SELECT RTRIM(name)+',' +RTRIM(street)+ ' t:'+RTRIM(telno ) AS search
FROM autodatabase
WHERE name LIKE '$keyword%'
But now it doesn't break the rows. It displays it as one long sentence
How can I break the rows but get 2 rows when asking for data en which string do I use to ask for the next rows (row 3 +4) with the same keyword?
Thanks
Priscillamuis
Comment