--- id: order title: 'order()' slug: /order custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml --- import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' Orders the result with the specified `column`. ```js const { data, error } = await supabase .from('cities') .select('name', 'country_id') .order('id', { ascending: false }) ``` ## Parameters ## Examples ### With `select()` ```js const { data, error } = await supabase .from('cities') .select('name', 'country_id') .order('id', { ascending: false }) ``` ### With embedded resources ```js const { data, error } = await supabase .from('countries') .select('name, cities(name)') .eq('name', 'United States') .order('name', { foreignTable: 'cities' }) ```