+ Start a Discussion

SOQL wildcard


This is pretty basic, but I can't figure it out by searching through docs (I can't seem to find the right docs), I would just like to return all the fields for a particular item, e.g Select all fields from Case.

Select id, Name from Account returns id and name, if I would like to get all the fields for Account, how do I write that query?

Select * from Account does not work. 
You will have to specify the fields you wish to get data for in  the SOQL query as you mentioned the * doesn' work as in SQL..
Read the following thread to get workaround using the describe call:http://stackoverflow.com/questions/8780413/salesforce-soql-query-to-fetch-all-the-fields-on-the-entity
Hi Eco42,

Please try the below query.

select Id,{!.} from Account