Forum Replies Created

Viewing 4 posts - 1 through 5 (of 5 total)

  • RE: How to join two tables using wildcards.

    OK.

    CREATE TABLE `records` (

    `ID` int(11) NOT NULL AUTO_INCREMENT,

    `SURNAME` varchar(45) DEFAULT NULL,

    `FORNAMES` varchar(45) DEFAULT NULL,

    `PREVIOUS` varchar(45) DEFAULT NULL,

    `DATEOFBIRTH` varchar(45) DEFAULT NULL,

    ...

  • RE: How to join two tables using wildcards.

    this is what i tried executing

    SELECT *

    FROM nia.nia_records r

    INNER JOIN nia.nia_districts d

    ON LEFT(r.CenterNo,CHARINDEX('-',r.CenterNo,0)-1) = d.district_Code;

    and i got this error message

    Error Code: 1305. FUNCTION CHARINDEX does not exist

  • RE: How to join two tables using wildcards.

    Thanks.I got this error message when i tried it

    SQL Error 1305: FUNCTION nia.CHARINDEX does not exist

    But i tried a different statement and it worked.That is

    select * from

    records n

    join districts...

  • RE: How to join two tables using wildcards.

    Thank you for the help.

    What i tried doing was, I have two tables namely (records and districts).The records table contain the following fields

    Records

    CenterNo

    Username

    Forenames.etc

    The districts table also contain the following fields

    Districts

    District...

Viewing 4 posts - 1 through 5 (of 5 total)