MySQL Forums
Forum List  »  GIS

join on
Posted by: Jacek Gancarson
Date: September 14, 2012 03:52AM

Hello,

I have to select the posts from the table `Dammreg` under condition that the string in the DNAM field includes the string from the field Damm_vk.NAMN
I have used the following sentence:

SELECT * FROM Dammreg INNER JOIN Dammreg ON Dammreg.DNAMN LIKE CONCAT('%', Damm_vk.NAMN, '%');

and received the error message: #1066 - Not unique table/alias: 'Dammreg'.

I used also the sentence:

SELECT * FROM Dammreg
JOIN TABLE Dammreg ON Dammreg.DNAMN LIKE '%'+ Damm_vk.NAMN +'%' with no result.

With this sentence:
SELECT * FROM Dammreg
JOIN TABLE Dammreg ON Dammreg.DNAMN LIKE '%' + @Damm_vk.NAMN + '%'
I receive the message: #1046 - No database selected.

Erlier I read the thread about error:#1066 and some other threads but still can not find what is wrong.

Server version: 5.1.63-0+squeeze1
Many thanks in advance

Options: ReplyQuote


Subject
Views
Written By
Posted
join on
4168
September 14, 2012 03:52AM
2473
October 16, 2012 05:34PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.