Last active
January 18, 2023 09:05
-
-
Save abdellani/855efaaf5179e69167c245bf4196d0c7 to your computer and use it in GitHub Desktop.
with references
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT "spree_line_items"."id" AS t0_r0, "spree_line_items"."order_id" AS t0_r1, "spree_line_items"."variant_id" AS t0_r2, "spree_line_items"."quantity" AS t0_r3, "spree_line_items"."price" AS t0_r4, "spree_line_items"."created_at" AS t0_r5, "spree_line_items"."updated_at" AS t0_r6, "spree_line_items"."max_quantity" AS t0_r7, "spree_line_items"."currency" AS t0_r8, "spree_line_items"."distribution_fee" AS t0_r9, "spree_line_items"."final_weight_volume" AS t0_r10, "spree_line_items"."tax_category_id" AS t0_r11, "spree_line_items"."weight" AS t0_r12, "spree_line_items"."height" AS t0_r13, "spree_line_items"."width" AS t0_r14, "spree_line_items"."depth" AS t0_r15, "variant"."id" AS t1_r0, "variant"."sku" AS t1_r1, "variant"."weight" AS t1_r2, "variant"."height" AS t1_r3, "variant"."width" AS t1_r4, "variant"."depth" AS t1_r5, "variant"."deleted_at" AS t1_r6, "variant"."is_master" AS t1_r7, "variant"."product_id" AS t1_r8, "variant"."position" AS t1_r9, "variant"."cost_currency" AS t1_r10, "variant"."unit_value" AS t1_r11, "variant"."unit_description" AS t1_r12, "variant"."display_name" AS t1_r13, "variant"."display_as" AS t1_r14, "variant"."import_date" AS t1_r15, "products_spree_variants"."id" AS t2_r0, "products_spree_variants"."name" AS t2_r1, "products_spree_variants"."description" AS t2_r2, "products_spree_variants"."available_on" AS t2_r3, "products_spree_variants"."deleted_at" AS t2_r4, "products_spree_variants"."permalink" AS t2_r5, "products_spree_variants"."meta_description" AS t2_r6, "products_spree_variants"."meta_keywords" AS t2_r7, "products_spree_variants"."tax_category_id" AS t2_r8, "products_spree_variants"."shipping_category_id" AS t2_r9, "products_spree_variants"."created_at" AS t2_r10, "products_spree_variants"."updated_at" AS t2_r11, "products_spree_variants"."supplier_id" AS t2_r12, "products_spree_variants"."group_buy" AS t2_r13, "products_spree_variants"."group_buy_unit_size" AS t2_r14, "products_spree_variants"."variant_unit" AS t2_r15, "products_spree_variants"."variant_unit_scale" AS t2_r16, "products_spree_variants"."variant_unit_name" AS t2_r17, "products_spree_variants"."notes" AS t2_r18, "products_spree_variants"."primary_taxon_id" AS t2_r19, "products_spree_variants"."inherits_properties" AS t2_r20, "suppliers_spree_products"."id" AS t3_r0, "suppliers_spree_products"."name" AS t3_r1, "suppliers_spree_products"."description" AS t3_r2, "suppliers_spree_products"."long_description" AS t3_r3, "suppliers_spree_products"."is_primary_producer" AS t3_r4, "suppliers_spree_products"."contact_name" AS t3_r5, "suppliers_spree_products"."phone" AS t3_r6, "suppliers_spree_products"."website" AS t3_r7, "suppliers_spree_products"."twitter" AS t3_r8, "suppliers_spree_products"."abn" AS t3_r9, "suppliers_spree_products"."acn" AS t3_r10, "suppliers_spree_products"."address_id" AS t3_r11, "suppliers_spree_products"."pickup_times" AS t3_r12, "suppliers_spree_products"."next_collection_at" AS t3_r13, "suppliers_spree_products"."created_at" AS t3_r14, "suppliers_spree_products"."updated_at" AS t3_r15, "suppliers_spree_products"."distributor_info" AS t3_r16, "suppliers_spree_products"."facebook" AS t3_r17, "suppliers_spree_products"."instagram" AS t3_r18, "suppliers_spree_products"."linkedin" AS t3_r19, "suppliers_spree_products"."owner_id" AS t3_r20, "suppliers_spree_products"."sells" AS t3_r21, "suppliers_spree_products"."producer_profile_only" AS t3_r22, "suppliers_spree_products"."permalink" AS t3_r23, "suppliers_spree_products"."charges_sales_tax" AS t3_r24, "suppliers_spree_products"."email_address" AS t3_r25, "suppliers_spree_products"."require_login" AS t3_r26, "suppliers_spree_products"."allow_guest_orders" AS t3_r27, "suppliers_spree_products"."invoice_text" AS t3_r28, "suppliers_spree_products"."display_invoice_logo" AS t3_r29, "suppliers_spree_products"."allow_order_changes" AS t3_r30, "suppliers_spree_products"."enable_subscriptions" AS t3_r31, "suppliers_spree_products"."business_address_id" AS t3_r32, "suppliers_spree_products"."show_customer_names_to_suppliers" AS t3_r33, "suppliers_spree_products"."visible" AS t3_r34, "suppliers_spree_products"."whatsapp_phone" AS t3_r35 | |
FROM "spree_line_items" | |
LEFT OUTER JOIN "spree_variants" "variant" | |
ON "variant"."id" = "spree_line_items"."variant_id" | |
LEFT OUTER JOIN "spree_products" "product" | |
ON "product"."id" = "variant"."product_id" | |
LEFT OUTER JOIN "spree_tax_categories" | |
ON "spree_tax_categories"."deleted_at" IS NULL | |
AND "spree_tax_categories"."id" = "product"."tax_category_id" | |
LEFT OUTER JOIN "spree_tax_rates" | |
ON "spree_tax_rates"."deleted_at" IS NULL | |
AND "spree_tax_rates"."tax_category_id" = "spree_tax_categories"."id" | |
LEFT OUTER JOIN "enterprises" "supplier" | |
ON "supplier"."id" = "product"."supplier_id" | |
LEFT OUTER JOIN "spree_products" "products_spree_variants" | |
ON "products_spree_variants"."id" = "variant"."product_id" | |
LEFT OUTER JOIN "enterprises" "suppliers_spree_products" | |
ON "suppliers_spree_products"."id" = "products_spree_variants"."supplier_id" | |
WHERE "spree_line_items"."id" = $1 | |
ORDER BY supplier.name, product.name, variant.display_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment