https://supabase.com/docs/reference/javascript/order
JavaScript: Order the results | Supabase Docs
JavaScript: Order the results Order the query result by column. You can call this method multiple times to order by multiple columns. You can order referenced tables, but it only affects the ordering of the parent table if you use !inner in the query. Para
supabase.com
const { data, error } = await supabase
.from('instruments')
.select(`
name,
section:orchestral_sections (
name
)
`)
.order('section(name)', { ascending: true })
const { data, error } = await supabase
.from('quiz')
.select(`
name,
참조테이블명 (컬럼영)
`)
.order('section(name)', { ascending: true })
========== 예시 ==========
const { data, error } = await supabase
.from('quiz')
.select(`
name,
quiz_reactions (view)
`)
.order('quiz_reactions(view)', { ascending: true })
========== 해설 ==========
quiz 테이블의 name 컬럼과 quiz_reactions 테이블의 view 컬럼을 조인해서 가져오세요~
가져올 때 quiz_reactions 테이블의 view 컬럼값 기준으로 오름차순 정렬해서 가져오세요~
'백엔드 > Supabase' 카테고리의 다른 글
[Supabase] 정책 생성 SQL 템플릿 코드 (1) | 2025.04.28 |
---|---|
[Supabase] 배열 객체 컬럼을 가진 테이블을 생성하는 방법 (0) | 2025.04.28 |
[Supabase] 수파베이스 이미지 불러오기 오류 (0) | 2025.04.17 |
[Supabase] 수파베이스 이미지 업로드 오류 체크사항 (1) | 2025.04.17 |
FCM 웹 푸쉬 알림 아이콘 변경 방법 | FCM 데이터 전달받는 방법 (0) | 2025.04.13 |