Most voted "select" questions
USE THIS TAG ONLY WHEN REFERRING TO DATABASE. SELECT is an SQL statement that returns zero or more rows, from one or more base tables, temporary tables, or views in a database. DO NOT USE to refer to the HTML "select" element, in which case use [html-select].
Learn more…807 questions
Sort by count of
-
-1
votes1
answer362
viewsUsing subselect in oracle. Why is the error occurring?
I’m trying to use this code below, but the oracle returns me the following error: ORA-00907: right parenthesis not found 00907. 00000 - "Missing right parenthesis" *Cause: *Action: Line error: 30…
-
-1
votes1
answer58
viewsQuery using WHERE
I need to make a query in a table called controls: I have the spine CH which is the workload in minutes and I have the column SETOR which are the sectors that have participated in some training. I…
-
-1
votes2
answers53
viewsDoubt SELECT Mysql
In a certain select I can reference two tables by foreign keys. Ex:Ida/ Idb Ida = Idb Table A has a column called C Table B has three columns called D, E, F Both tables have similar contents to…
-
-1
votes2
answers849
viewsCondition within the WHERE clause
Good afternoon ! I have a task to perform a select, but the parameters are passed as variables and I need to treat the input of one of these variables with the following logic: if &CT is not…
-
-1
votes1
answer72
viewsMark a checkbox field if one or two options are chosen in the select field
I have a selection field with four options. If option 1 is chosen, I want you to mark a checkbox field (WHITE) How do I do…
-
-1
votes2
answers880
viewsselect name in bank with C#
I am developing an application in C# windows form in 3 layers. My problem is: I have a datagridview to receive data from the bank and a textbox to be typed the name I want to search for in the bank,…
-
-1
votes3
answers37
viewsList of vehicles that are without photos
I need the list of vehicles that do not have registered photos. I have a Vehicles table, an Image table and another Type. Example: tbVeiculo (VeiculoId, DataCadastro, Etc...) tbImagemVeiculo…
-
-1
votes2
answers1365
views"ORA-01417: a table may be Outer joined to at Most one other table"
I’m riding a select and I came across the following mistake: ORA-01417: a table may be Outer joined to at Most one other table SELECT A.SEQPESSOA, A.NUMERONF, A.NROEMPRESA, A.SEQPRODUTO,…
-
-1
votes1
answer492
viewsChange content according to select option
Someone could assist me on how I can change the information that is in blue in the image below, according to the selection of the select (monthly, quarterly, semi-annual and annual). I need you to…
-
-1
votes2
answers424
viewsStyle Bootstrap 4 select combo box
boostrap 4 combo box styling is possible ? <div class="form-group"> <select class="form-control pesquisa__select col-12"> <option>teste 01</option> <option>teste…
-
-1
votes1
answer379
viewsCannot access field on a value with type ARRAY
I’m trying to pull the spine name.pt_BR that is inside the column namebut I still don’t understand how to get it specifically in Bigquery. How to pull this info to give JOIN in another query later?…
-
-1
votes4
answers2232
viewsSelect option selected
I need to leave the select option selected according to the field saved in mysql. The form is to edit so it displays the fields available with foreach. Ex: <select name="segurado" > <option…
-
-1
votes1
answer59
viewsWhich country had the largest total population each year
I created this table: CREATE TABLE `Populacao` ( `ano` int(11) NOT NULL, `pais` varchar(2) NOT NULL, `popM` varchar(10) DEFAULT NULL, `popF` varchar(10) DEFAULT NULL, ); Where popM is the male…
-
-1
votes2
answers5049
viewsCheck if record exists in the table and return in mysqli
Hello I have a table called logs id | usuario_id | produto_id 1 | 10 | 20 2 | 10 | 30 3 | 20 | 30 4 | 20 | 20 They are logs stating that the user with id 10 has already seen the product with id 20,…
-
-1
votes2
answers257
views -
-1
votes2
answers426
viewsView multiple records within one in Mysql
I have a question as to the mounting of a select. I have 3 tables that relate M:N as follows: Currently I am using this sql: select p.descricao, (select descricao from item where item.codigo =…
-
-1
votes1
answer71
viewsHow to order query in MYSQL by relevance? (first results that the term is in the title, then in the content)
I have a table as follows: id|nota|titulo |ingredientes 1 | 3 |pão de batata|batata;farinha;agua;ovo 2 | 2 |bacalhoada |bacalhau;batata;pimentão 3 | 1 |batata frita |batata When I do a search that…
-
-1
votes1
answer29
viewsQUERY MARIA DB TO FILTER CURRENT TIMESTAMP ONLY
The query: SELECT DISTINCT hosts.name as "Unidade de Negócio", CASE WHEN services.acknowledged = 1 THEN acknowledgements.comment_data ELSE 0 END AS "Análise", hosts.last_state_change*1000 as…
-
-1
votes2
answers96
viewsDo you doubt how to store the ID of a record brought from the bank for later use in PHP?
How could I store the ID of each record, and the ID_PESSOAS by going through the while ($exibe = mysqli_fetch_assoc($dados) so that in the future the user click on the "see vacancies" button I know…
-
-1
votes1
answer302
viewsCalculate duration time - Firebird 2.5
I have the following table: Stages: 0 = Separation, 1 = Packaging, 2 = Conference, 3 = Shipment Status: 0 = Waiting, 1 = Started, 2 = Finished, 3 = Paused And this table is part of this screen: For…
-
-1
votes1
answer103
viewsPull value from a column with select mysql to php
Hello! I have this bank: SELECT * FROM player_index WHERE player_index.empire Query return: https://prnt.sc/pk8k1u And I have this code below,: <?=$players[$i][1]?> <table…
-
-1
votes1
answer179
viewsFilter information from a CASE WHEN SQL and only results that contain all information
I need to return only the result that contains all the information that in the case of this image and the ID='8187' Select d.ID, d.post_title, d.post_type, MIN(CASE WHEN b.name = 'Resinas' THEN…
-
-1
votes1
answer36
viewsUnrealized/ subquery failing
Using Sub-Query, make a query that returns the active materials, with the Description, Batch, Barcode Cod and Validity only of Dt Smaller validity of each Material. My code so far: select…
-
-1
votes1
answer51
viewsBring result in a row to Join between tables with 1:N relationship
I have the following problem in SQL Server I have the tables CLIENTE and TELEFONE, with a relationship of 1:N among them: CREATE TABLE CLIENTE( CPF CHAR(11) NOT NULL PRIMARY KEY , NOME VARCHAR(500)…
-
-1
votes1
answer1642
viewsLimit decimal places - SQL Server
Opaa! I made a select of a table that returns the value of a book with a percentage of adjustment, both negative and positive. But it is returning me a value with several decimal places, and I would…
-
-1
votes1
answer37
viewsAdd values from a column in the table
I need to select the 3 users with the highest revenue. Before in the table cde_usuario there was a column called scythe, being very simple to make this query, used this sql: $sql = "SELECT * FROM…
-
-1
votes1
answer67
viewsUpdate with JOIN with 2 tables together with Select
Hello, I’m with the following query to perform in a database but locked in a situation, below follows the query, the error message and then the explanation. Excerpt from the Code USE BDTESTE GO…
-
-1
votes1
answer64
viewsSQL - search data from different tables without relationship with Ids
Personal table (id, cnae, cnpj, ...) (amount of records 40M) Table cnae_secundario (id, cnae, cnpj) has no attachment by id with the personal table. (amount of 50M records) The user will inform the…
-
-1
votes1
answer48
viewsselect brings up input and select fields
Staff need that the field of imput appears and the field select with the status when the user selects your area of action if he selects Academic, Other or I’m not from Areá da Saúde not appear that…
-
-1
votes2
answers56
viewsHow to ignore a query line in the database?
I am trying to develop a code to create dynamic tables with php and mysql, using an Asterisk database. My first difficulty is that the recording of calls are duplicated (or quadrupled), if the…
-
-1
votes1
answer21
viewsDuplicate results
I have two tables product:{ pid namesake value category stock Eston stocking } pictures{ fid name product } And I’m trying to make a query in the bank where I need to take everything that is in the…
-
-1
votes1
answer83
viewsI need to make a Select in 3 different tables and do not know how to do
Next I need to make a query in the following conditions: I need the table data A (Numero, Ano, vencimento, Nome); seeking the information of unwelcome in the column Recebimento table B; and I need…
-
-1
votes1
answer82
viewsHow to get the "value" of a select in Reactjs
I made the following code, I would like to take the value of the "value" of the select, (the car color and show in the H3 tag when the button is triggered) I tried to use .target.value but without…
-
-1
votes0
answers19
viewsHow to Select Field from a Table in Microsoft SQL Server Management Studio (SSMS) through C#?
I am making a login system, and for the login to be valid, I must read the value entered in txtNome (where the user will have entered the name he registered), save the text in a variable and perform…
-
-2
votes1
answer38
viewsI will create a select and would like it to update the amount of records
I am creating a system and in the part of registering products in php a select with the option of how many products will be registered, I would like q when choosing the select updated to appear the…
-
-2
votes1
answer71
viewsDoubt to count records in a Mysql database query
In a Mysql database, I have two varchar columns that bring me records in this format: ["165","184","192","209","242"] One more example: Each number in double quotes is a record, IE, is the ID of…
-
-2
votes3
answers659
views -
-2
votes1
answer34
viewsSELECT works in phpMyAdmin but in php application the same SELECT does not work
I have an order table with two foreign keys, sender and recipient which is the primary key of the person table. When I do SELECT in phpMyAdmin the result is correct. But in my application the name…
-
-2
votes1
answer31
viewsTables of MYSQL
As the image shows, I have the table adms_unidade where I can already show the units listed, and I have the table adms_equipamentos with various registered equipment. I want to show how many…
-
-2
votes1
answer95
viewsI need help with the PHP language
So guys I’m having a hard time in a part of my code, as it is too big I will post only the part that is wrong: <?php try{ $entrar = $_POST["entrar"]; $cpf = $_POST["cpf"]; $senha =…
-
-2
votes3
answers404
viewsCategory and Subcategory Sum with PHP and MYSQL
I already broke my head and I’m lost in finding the solution to my problem, I’m developing a financial report that has categories and subcategory (7 levels) Below is the structure of part of my…
-
-2
votes2
answers116
viewsTo disable textarea when select is set to value false
I would like to disable the textarea if select is false, and enable if select is true. I was trying to do for DOM, but I did not succeed, below this code I have, in case someone can help me. <div…
-
-2
votes1
answer62
viewsDatabase - Mysql - Relationship between tables / INNER, LEFT, RIGHT JOIN
I am making a database using the Mysql Workbench and I am in need of a brief assistance. I have six entities in total. tb_people who are related to two other tb_clients and tb_adm entities (because…
-
-2
votes1
answer31
viewsAdd values in the field by pressing the 'enter' key and reset these values with the 'reset' button in Javascript
What do you say? How can I add values in the field by pressing the 'enter' key instead of clicking the 'add' button and how to reset these values within the 'select' button with the 'reset' button…
-
-2
votes1
answer26
viewsMYSQL query date range and any other date in the same query
I have the following dates as an example: 2021-06-01 2021-06-02 2021-06-03 2021-06-04 2021-06-05 would like to display 2021-06-01, 2021-06-02, 2021-06-03 and 2021-06-05 I am trying to do it this…
-
-2
votes0
answers34
viewsSelect two tables at once
I got the city and neighborhood tables How do I display the city and neighborhood it belongs to ? tried to use a INNER JOIN but it didn’t work ? in that inner join has a $_GET that should fetch the…
-
-3
votes1
answer57
viewsSQL Database
Hello! I am in training in Support and I’m having difficulty understanding the logic of select, I need to make script for example: bring the status of the table Criteria.
-
-3
votes1
answer77
viewsHow to use select in a table that is not related?
I need to build an SQL query that lists the amount payable for each km, quantity of km used and the total amount payable by each lease It is an exercise of SELECT and Inner/left Join but do not know…
-
-3
votes1
answer41
viewsvariable pass to a select
I would like to pass the variable value $var into select, but gives the following error : Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, bool given in…
-
-3
votes1
answer100
viewsDoes anyone know how it is possible in postgresql, I have two tables with column type ARRAY and use WHERE, to select the records by this column?
I have two TABLE . TAB1 and TAB2 TAB1 GROUPS = {11, 15, 13, 20} TAB2 got the spine: REG1 GROUPS = {11, 8, 15} REG2 GROUPS = {21, 5, 7} REG3 GROUPS = {1, 13, 21} Make a SELECT using the table column…