Most voted "sqlfiddle" questions
17 questions
Sort by count of
-
33
votes4
answers5507
viewsWhy are NULL values not selected?
When making a select, I noticed that the data with field NULL are not recovered using the operator<>. Why does this happen? NULL is equal to a char N? See that in the query below only the…
-
4
votes5
answers620
viewsHow to select records that have a relationship with all values in a list?
I have the following sql: SELECT DISTINCT cp_pessoa.id, cp_pessoa.nome FROM cp_pessoa LEFT JOIN cp_habilidade_freelancer ON (cp_habilidade_freelancer.id_freelancer = cp_pessoa.id) LEFT JOIN…
-
4
votes5
answers57768
viewsCount equal records with SELECT DISTINCT and COUNT
How do I count the equal results and add the amount in front? For example: Currently the records of my table are like this: Id | Nome ------------ 0 | Teste 1 | Teste 2 | Teste I want to give a…
-
4
votes2
answers509
viewsFormat Mysql Now() function return
So personal. I need to know if there’s any way to send only the H:i:s hours of the function NOW() in the database, or send the NOW() complete and then fetch only the time?…
-
3
votes2
answers3054
viewsFormat CPF column with regular expression
In a table containing the column CPF I would like to format it in order to present the content properly. By appropriate way I refer to the format 999.999.999-99. It is possible to format this…
-
3
votes1
answer780
viewsMysql complex banking type statement how to solve
I have a VIEW table that I need to extract an extract from it, already managed with help right here from the stackoverflow progress to an extract. The problem is that now I need to filter this…
-
3
votes1
answer131
viewsColumn for Mysql row
I have the following table: | Roll No | Student Name | Q1 | Q2 | Q3 | |--------------|--------------|--------|------|------| | 1 | Aluno 1 | 1 | 1 | 1 | | 2 | Aluno 2 | 1 | 1 | 0 | | 3 | Aluno 3 | 1…
-
3
votes2
answers299
viewsError calling PROCEDURE in SQL Fiddle
When making a call PROCEDURE in SQL Fiddle, the following error is displayed: DDL and DML statements are not allowed in the query panel for Mysql; only SELECT statements are allowed. Put DDL and DML…
-
2
votes5
answers1449
viewsSorting in query - Leave last registration in first and then sort by a field
I’m having to create a query that returns the data ordered by a specific field, for example name, but the first return line should be the last id. You can do this with sql? Let’s assume I have the…
-
2
votes1
answer202
viewsHelp with GROUP_CONCAT (Mysql)
I’d like to use a grupo_concat for filename and answer but not to repeat the values of filename and answer Follows sqlfiddle: http://sqlfiddle.com/#! 9/f32d78/1/0 It is a question that has 2 images…
-
2
votes3
answers121
viewsSelect the first result of each conversation
How can I select the first line of each conversation from a specific user where the to_id = 1. The big problem is when the first message exchanged from the conversation does not have the top_id = 1…
-
1
votes1
answer1370
viewsReturn only one item related to the main table
I have two tables, respostas and respostas_log, where I store information of the answers in answers and some others that have to go logging in reply_log. I am needing in my SELECT to bring only the…
-
1
votes1
answer1070
viewsHow to count NULL type values in Mysql
I have a simple table with the answers, in this table I can have answers with value null, 0, 1, 2, 3, ... , only when I count the number of responses with each value these with the value null does…
-
1
votes1
answer375
viewsHow to return the total amount when using OFFSET and FETCH NEXT?
I had to use OFFSET and FETCH NEXT to return a data range between my query. Table CREATE TABLE [dbo].[Usuario] ( [Id] [int] IDENTITY(1,1) NOT NULL, [Email] [nvarchar](max) NULL, [Nome]…
-
0
votes1
answer100
views -
0
votes1
answer238
viewsHow to display the result of an Inner Join for the user?
I have three tables and want to join them and display them to the user, how can I do this using the functions of Wordpress? INSERTS THE DATA INTO THE DATABASE: function cadastra_experiencia($nome,…
-
0
votes2
answers389
viewsSum the value of the column by grouping monthly and by product
Staff I need to calculate the monthly consumption of the licenses used here in the company I work. I have a table with the product (dbo. Product), the number of licenses installed on the server…