---
id: maybesingle
title: "maybeSingle()"
slug: maybesingle
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
---

import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';

Retrieves at most one row from the result. Result must be at most one row
(e.g. using `eq` on a UNIQUE column), otherwise this will result in an
error.

<Tabs
  defaultActiveId="js"
  groupId="reference/supabase-js"
  values={[{ label: 'JavaScript', value: 'js' }]}>

<TabsPanel id="js" label="js">

```js
const { data, error } = await supabase
  .from('cities')
  .select('name, country_id')
  .eq('name', 'Singapore')
  .maybeSingle()
```


</TabsPanel>

</Tabs>

















## Examples

### With `select()`



<Tabs
  defaultActiveId="js"
  groupId="reference/supabase-js"
  values={[{ label: 'JavaScript', value: 'js' }]}>

<TabsPanel id="js" label="js">

```js
const { data, error } = await supabase
  .from('cities')
  .select('name, country_id')
  .eq('name', 'Singapore')
  .maybeSingle()
```


</TabsPanel>

</Tabs>