1. i would like to select all records and where customers have more than 1 Address return the Address with the Address Type = ‘Postal’.
Can anyone please help with the above question.
CREATE TABLE `bulksms`.`tblContact` (
`ipkContact` INT NOT NULL ,
`ifkContactType` varchar(10) ,
`FirstName` VARCHAR( 50 ) NOT NULL ,
`Surname` VARCHAR( 50 ) NOT NULL ,
`BusinessName` VARCHAR( 75 ) NOT NULL ,
`Telephone1` VARCHAR( 12 ) NOT NULL ,
`Telephone2` VARCHAR( 12 ) NOT NULL
) ENGINE = InnoDB;
CREATE TABLE `bulksms`.`tblAddress` (
`ipkAddress` INT NOT NULL ,
`ifkContact` INT NOT NULL ,
`ifkAddressType` varchar(10) not Null,
`Line1` VARCHAR( 50 ) NOT NULL ,
`Line2` VARCHAR( 50 ) NOT NULL ,
`Line3` VARCHAR( 50 ) NOT NULL ,
`PostCode` INT NOT NULL
) ENGINE = InnoDB;
Can anyone please help with the above question.
CREATE TABLE `bulksms`.`tblContact` (
`ipkContact` INT NOT NULL ,
`ifkContactType` varchar(10) ,
`FirstName` VARCHAR( 50 ) NOT NULL ,
`Surname` VARCHAR( 50 ) NOT NULL ,
`BusinessName` VARCHAR( 75 ) NOT NULL ,
`Telephone1` VARCHAR( 12 ) NOT NULL ,
`Telephone2` VARCHAR( 12 ) NOT NULL
) ENGINE = InnoDB;
CREATE TABLE `bulksms`.`tblAddress` (
`ipkAddress` INT NOT NULL ,
`ifkContact` INT NOT NULL ,
`ifkAddressType` varchar(10) not Null,
`Line1` VARCHAR( 50 ) NOT NULL ,
`Line2` VARCHAR( 50 ) NOT NULL ,
`Line3` VARCHAR( 50 ) NOT NULL ,
`PostCode` INT NOT NULL
) ENGINE = InnoDB;