SELECT
SELECT [TOP number] expression [ [AS] output_name ] [, ...] ] [FROM entity_logicalname [alias] [{INNER | LEFT} JOIN ...] ] [ WHERE <search_condition> ] [ ORDER BY expression [ ASC | DESC ]]
|
Examples
select top 20 contactid, fullname, contact.statecode.name from contact where (statecode=0 and firstname is not null)
select c.contactid, ownerid, c.fullname, a.name from contact as c inner join account as a on c.parentcustomerid = a.accountid where c.fullname like 'Bob%' order by ownerid desc, fullname