question

MJL1956 avatar image
MJL1956 asked

Sql code for this logic

I am probably trying to run before I can walk but I am trying to code something that will follow this logic.


If Title (table1) = Title (table2)

And Artist (table 1) = Artist (table 2) then

copy Path (table 2) to Path (table 1)


Any help would be appreciated .

sql2012
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

anthony.green avatar image
anthony.green answered
Update t1

Set t1.path = t2.path

From t1

Inner join t2

On t1.title = t2.title

And t1.artist = t2.artist
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

MJL1956 avatar image
MJL1956 answered

Thanks for your response, I tried the code but it came back syntax errors. I then tried some of the built in Queries with the same result. I must have a error with the way I setup the database, so I think its back to the drawing board for me. Again many thanks for you reply.

Martin

1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

What syntax errors did it come back with?
0 Likes 0 ·
MJL1956 avatar image
MJL1956 answered

Anthony,

Nothing useful, no error code just update syntax error.

The last time I coded anything was early 70's using ANS Cobol.

I am new to access and SQL so think the problem is the way I have created the database, even the inbuilt queries are returning a generic syntax error. I am sure the code you gave me is correct.

I am going to leave this for a while so again many thanks for helping.

Regards

Martin

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.