in reply to Re^7: sql join with multiple select
in thread sql join with multiple select

sorry i mixed city with country and also forget to include title

but this is the MSG Table and thats wat i want to select

SELECT SND.userid, SND.fname, SND.lname, SND.title, SND.age, SND.count +ry

Replies are listed 'Best First'.
Re^9: sql join with multiple select
by poj (Abbot) on Oct 05, 2018 at 14:36 UTC

    It looks like the table alias names SND and M are confusing you so remove them.
    If this is now your tables

    TABLE users userid firstname lastname 1 JOHN DEO 2 JANE DEO TABLE msg msg_id msg_from msg_to received age city country

    The correct SQL (without alias names) is

    SELECT users.userid, users.firstname, users.lastname, msg.age, msg.cit +y, msg.country FROM msg JOIN users ON users.userid = msg.msg_from WHERE msg.msg_to = ? AND msg.received IS NULL
    poj

      thanks poj.

      i was already fixed my query