Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple SQL Select

Status
Not open for further replies.

kurie

Programmer
Jun 4, 2008
170
ZA
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;


 
yes, and a.ipkAddress =c.ipfAddressType
Its a Sql Server database, even though i scripted the tables in MYSQL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top