Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page explique comment configurer et afficher des rapports prédéfinis dans BigQuery.
Dans la console Google Cloud , vous pouvez écrire votre requête personnalisée en fonction du nom de la table ou du rapport prédéfini, puis l'enregistrer en tant que requête ou en tant que vue.
Écrire des requêtes personnalisées dans BigQuery en tant que requête
Pour écrire des requêtes personnalisées dans BigQuery en tant que requête, procédez comme suit:
Dans la Google Cloud console, accédez à la page BigQuery Studio:
Dans le panneau Explorateur, développez votre projet et sélectionnez un ensemble de données.
Cliquez sur le nom de l'ensemble de données pour le développer.
Les tables et les vues de l'ensemble de données s'affichent.
Cliquez sur le nom du tableau ou d'un rapport prédéfini.
L'onglet Details (Détails) affiche la description de la table, et l'onglet Schema (Schéma) affiche la définition du schéma de la table.
Cliquez sur Requête, puis sélectionnez Dans un nouvel onglet ou Dans un onglet divisé.
Un nouvel onglet s'ouvre avec un exemple de requête.
Écrivez une requête basée sur les noms de champ renseignés dans l'onglet Schéma.
Cliquez sur Exécuter. L'aperçu des résultats de la requête s'affiche.
Cliquez sur Enregistrer la vue.
Dans la boîte de dialogue Enregistrer la vue, procédez comme suit:
Dans la liste Project (Projet), cliquez sur Browse (Parcourir) et sélectionnez un projet.
Dans la liste Ensemble de données, sélectionnez un ensemble de données où stocker la vue. L'ensemble de données contenant la vue et celui contenant les tables référencées par celle-ci doivent se trouver dans le même emplacement.
Dans Nom de la table, saisissez un nom pour la vue.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eBigQuery allows you to write custom queries based on table names or prebuilt reports within the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eYou can save custom queries in BigQuery as a query, enabling you to reuse them later by naming the query in the save query dialog.\u003c/p\u003e\n"],["\u003cp\u003eCustom queries can also be saved as a view, allowing for the selection of a project, dataset, and table name within the save view dialog.\u003c/p\u003e\n"],["\u003cp\u003eWhen creating queries or views, users must select a dataset where the view is stored, and the dataset must be in the same location as the tables referenced.\u003c/p\u003e\n"]]],[],null,["# Custom queries in BigQuery\n\nThis page explains how to set up and view prebuilt reports in BigQuery.\n\nIn Google Cloud console, you can write your custom query based on the table name\nor prebuilt report and save it as a query or as a view.\n\nWrite custom queries in BigQuery as a query\n-------------------------------------------\n\nTo write custom queries in BigQuery as a query, do the following:\n\n1. In the Google Cloud console, go to the **BigQuery Studio** page:\n\n [Go to BigQuery Studio page](https://console.cloud.google.com/bigquery)\n2. In the **Explorer** panel, expand your project and select a dataset.\n3. Click the dataset name to expand it.\n\n The tables and views in the dataset appear.\n4. Click the table name or a prebuilt report.\n\n The **Details** tab displays the table's description and the **Schema** tab displays the table's schema definition.\n5. Click **Query** and select either **In new tab** or **In split tab**.\n\n A new tab opens with a sample query.\n6. Write a query based on the field names that are populated in the **Schema** tab.\n\n7. Click **Run**. This displays the preview of the query results.\n\n8. Click **Save query**.\n\n9. In the **Save query** dialog, type a name for the saved query.\n\nYou can download and save queries to the selected location. For more information, see [Downloading and saving query results from the Google Cloud console](/bigquery/docs/writing-results#downloading-saving-results-console).\n\nWrite custom queries in BigQuery as a view\n------------------------------------------\n\nTo write custom queries in BigQuery as a view, do the following:\n\n1. In the Google Cloud console, go to the **BigQuery Studio** page:\n\n [Go to BigQuery Studio page](https://console.cloud.google.com/bigquery)\n2. In the **Explorer** panel, expand your project and select a dataset.\n3. Click the dataset name to expand it.\n\n The tables and views in the dataset appear.\n4. Click the table name or a prebuilt report.\n\n The **Details** tab displays the table's description and the **Schema** tab displays the table's schema definition.\n5. Click **Query** and select either **In new tab** or **In split tab**.\n\n A new tab opens with a sample query.\n6. Write a query based on the field names that are populated in the **Schema** tab.\n\n7. Click **Run**. This displays the preview of the query results.\n\n8. Click **Save view**.\n\n9. In the **Save view** dialog, do the following:\n\n 1. In the **Project** list, click **Browse** and select a project.\n 2. In the **Dataset** list, select a dataset to store the view. The dataset that contains your view and the dataset that contains the tables referenced by the view must be in the same [location](/bigquery/docs/dataset-locations).\n 3. In **Table name**, enter a name for the view.\n 4. Click **Save**.\n\nYou can download and save queries to the selected location. For more information, see [Downloading and saving query results from the Google Cloud console](/bigquery/docs/writing-results#downloading-saving-results-console).\n\nWhat's next\n-----------\n\n- Learn how to [View prebuilt reports in Google connected sheets](/backup-disaster-recovery/docs/monitor-reports/view-reports-sheets)\n- Learn how to [View prebuilt reports in Looker](/backup-disaster-recovery/docs/monitor-reports/view-reports-lookerstudio)"]]