Posts by rbz • 9,949 points
356 posts
-
1
votes1
answer43
viewsA: Search Word Combination in SQL (Redshift)
You can use a direct test in the query and already bring the status, because the way you are doing, it makes no sense to have the column mesclado, and will have to make several queries to list all…
-
2
votes1
answer193
viewsA: Count how many times a value appears in a PHP and SQL Column
Give an alias the count: SELECT conta, COUNT(0) total FROM clients GROUP BY conta In the while check that the total is greater than 5, and set the disabled, and the rest is to concatenate: <?php…
-
1
votes1
answer106
viewsA: Place only two decimal places in a sqlServer sum function
Try it like this: SELECT ROUND(SUM(valorcobrado),2) FROM vendasservicos Reading on the ROUND.…
sql-serveranswered rbz 9,949 -
3
votes1
answer43
viewsQ: Visible index or not?
About using the parameter Visible of index of a table, I would like to know: What is the effect of this parameter on a table field? This parameter is specific to Mysql or found in other BD? Will…
-
1
votes2
answers1029
viewsA: Image in Listtile - Flutter
The ideal would be the CircleAvatar, in view of the image that has passed, and as already commented. Example: import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp…
-
0
votes1
answer833
viewsA: Layout button in flutter
I do not believe that it is very right to make a "circle" for this. I did it differently (I didn’t review it, so I might have a way to improve it) and I don’t know if it’s what you want, because…
-
1
votes1
answer166
viewsA: Ignore column alignment in flutter
Your problem is your size-less column, so it fits your kids' content (childrens). In this case, you must set a size, or expand dynamically. Solving One option would be Expanded, see in the example…
-
0
votes1
answer90
viewsQ: Field of type ENUM empty arrow when not a valid value
Test scenario Data set: 10.4.11-Mariadb Table: tabela Campos: id (INT, PK, NOT NULL), ativo (ENUM('S','N'), NOT NULL) Instruction UPDATE tabela SET ativo = 'XXX' WHERE id = 1 Return 1 Row(s)…
-
1
votes0
answers50
viewsQ: Should I avoid Queries?
Example scenario I have 3 tables: relatorios, atividades and carros. Table relatorios, will be the "cover" of the day, with date, initial and final mileage, etc. Table atividades, will be each…
-
3
votes0
answers36
viewsQ: Object comparison in "Flyweight Pattern"
I was reading that question, and I was left in doubt as to how the comparison is made between the objects, thus determining which object would be equal to the other, and which would be a new object.…
-
0
votes1
answer336
viewsQ: Calculate difference between dates (no time) with strtotime - use of date_default_timezone_set() gives different results
Example scenario I had a problem with a simple day count between 2 dates. One resulted me in 5 and the other 6, and was using the same dates with the same function, only in different files. The…
-
4
votes2
answers401
viewsQ: "Watermark" with CSS
Test scenario I have an input on a <td>, in which the background of <td> has color: td { padding: 2em; background-color: yellow; } <table> <tr> <td class="marcado">…
-
1
votes1
answer93
viewsQ: Clone element by changing name value
Example scenario I have a form which it possesses in the name, 2 specific values: X[Y] X is a reference to the vision code, and Y concerning the field of my vision, and the value of input, shall be…
-
12
votes2
answers482
viewsQ: What would be the "identity" of an object?
Reading more about objects, trying to "detach" me from the concept that object would only be provided with a "class", in this answer, I saw the following sentence: "Objects have identity. A variable…
-
2
votes1
answer595
viewsQ: Touch effect (touch ripples) on long touches, with Inkwell
We can create a button with a Container, so leave it as we wish. My doubt, is in the touch effect with the InkWell, that a color is added to the Container, the same "stops working" as in the…
-
1
votes2
answers522
viewsQ: Current value of an "auto increment" field in Postgresql
I would like to know, what are the ways of obtaining the current position of the value "auto increment" of columns of a table in the Postgresql.
postgresqlasked rbz 9,949 -
0
votes4
answers114
viewsA: Doubt QUERY SQL construction
Updating For his new explanation, the closest answer would be "anonymity". I would make just one adjustment, but it would be the same: SELECT A.CODIGO, A.DATAP, A.VALOR FROM TB1 A LEFT OUTER JOIN…
-
1
votes1
answer72
viewsA: How to make a select taking into account if the record exists, if it does not exist return null or empty
To be null you do not return the else or return null. Similarly, in the sum, you do not need to return 0. SELECT empresas, tipo_atividade, (CASE WHEN (SUM(CASE WHEN MONTH(dt_vencimento) = 1 THEN 1…
-
1
votes1
answer88
viewsA: How to get a Procedure return using ODBC in PHP?
The return is true because it is returning that the function was successfully executed. Could use the odbc_fetch_array: $rs = odbc_execute($exc,array($par1,$par2,$par3)); if (is_resource($rs)) {…
-
3
votes3
answers141
viewsA: Result range
One way would be to use a variable: SET @data := (SELECT data FROM tab1 ORDER BY data LIMIT 1); SELECT * FROM tab1 WHERE data IN ( SELECT (CASE WHEN data >= (SELECT data FROM tab1 WHERE data…
-
2
votes2
answers388
viewsA: How do replace in all fields except one?
Solution 1 One option I would use would be INSERT with ON DUPLICATE KEY UPDATE: INSERT INTO table1 SET id="123", campo_recebido1 = "1", campo_recebido2 = "1234", campo_recebido3 = "texto",…
-
1
votes4
answers94
viewsA: How do I make the CSS class not affect anyone who has a particular class?
.navbar-solid > li a .navbar-solid > li a:hover, i:hover .navbar-solid > .dropdown { background-color: transparent !important; …
-
2
votes2
answers84
viewsQ: Keep in array the serialize
In the example below, I do the serialize and already step straight in 'date', in ajax: function filtrar() { $.ajax({ type: 'post', dataType: "text", data: $('#filtros').serialize(), url:…
-
1
votes1
answer80
viewsA: Copy a column from a given table to another column from another table
As Motta said in the comment, there’s probably more than 1 entry coming in your subquery. I believe that with JOIN you would solve this case: UPDATE pctabpr SET ptabela = E.ptabela FROM pctabpr A…
-
2
votes2
answers406
viewsA: Select 2 latest records from Sql Server table
I’d like to take the last two records and make the difference between the Timestamp of the last 2 records. Whereas you’ll always have it in order 0 and 1 in value, then you can do for sub-query…
-
0
votes1
answer47
viewsA: Consult data in three tables where only two are related
I don’t understand very well what you want and you can’t know very well without the values. To relate would JOINS: SELECT A.X, A.Y, B.X, B.Y, C.X, C.Y FROM TAB_A A LEFT JOIN TAB_B B ON B.PK = A.FK_B…
-
1
votes1
answer479
viewsA: How to limit a composite query in Firebase/flutter
final QuerySnapshot result = await Future.value(Firestore.instance .collection("lockers") .where("userid", isEqualTo: "$_uid") .where("numero_serie", isEqualTo: "$_numeroSerie")…
-
1
votes2
answers493
viewsA: Count number of rows of different tables doing LEFT JOIN using the Count() function
Some possible errors in your table structure: Why a table videos if you already have a related table tipo_midia? Why repeat id_tipo_ midia in the tables cliques and curtidas? If you do not use time,…
-
0
votes2
answers60
viewsQ: Infinite scroll does not update with CSS class
Goal I have a table populated by the database, and would like to update as scroll is ending. Test scenario $(document).ready(function() { $("#regs").scroll(function() { if ($(this).scrollTop() +…
-
6
votes1
answer4362
viewsQ: Free Mysql remote access 8
I’m testing the new version 8 of Mysql, and encountered some difficulty in releasing remote access (specifically, using the Workbench). What I found was same question on Soen, and only one…
-
0
votes1
answer201
viewsQ: Double-line button in text
I wonder if you can make a button that has 2 pre-separated lines for the text. For example: <button> <span>cima</span> <span>baixo</span> </button> He’d give me…
-
4
votes2
answers82
viewsQ: Differences between event definitions
Examples 1. <button onclick="clickTeste()">Teste</button> function clickTeste() { alert("click"); } 2. (the most commonly used) $("#testeid").click(function() { alert("click"); }); 3.…
-
5
votes2
answers211
viewsQ: Select next elements
I have a table with inputs <tr> <th>Linha X</th> <td><input type="number" name="AAA"></td> <td><input type="number" name="BBB"…
-
-1
votes1
answer537
viewsQ: Resize input size inside table
Test scenario I have a table within a form, because I need to make a form aligning rows and columns to the inputs. Example: <table class="table table-bordered" style="font-size: 0.8rem">…
-
5
votes2
answers56
viewsQ: Scripts - Load all or split?
I have a page with several static elements, these which, load dynamic elements, basically all in body distributed in divs, via Ajax. These dynamic elements use several functions, relative to each of…
-
1
votes1
answer59
viewsQ: Duplication of jQuery event
Test scenario index <!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> <title></title> <script…
-
1
votes1
answer89
viewsQ: Sort array as more than one condition
Test scenario I got the following array, where the records are related, ie the key of each level, is related to the other: Array ( [regs] => Array ( [c1] => Array ( [0] => 1 [1] => 2 [2]…
-
6
votes1
answer44
viewsQ: Focus on minutes in time type input
Is there any way to "focus" the minutes of a input of the kind time? By default, the focus() direct to the "hours" that is the beginning of the input, empty or filled: <link…
-
5
votes3
answers254
viewsQ: Search id of relative element of relative
Goal Fetch the id the "father’s father" of an element. Test scenario function filhoPai(filho){ var filhoId = '#' + filho; var pai = $(filhoId).parent().attr('id'); alert(filho + ' - ' + pai) }…
-
5
votes2
answers156
viewsQ: Pin tabs bar below navigation bar (navs x navbar)
Goal Create a tabs menu bar, below a menu bar, both fixed. Test scenario <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script…
-
2
votes3
answers298
viewsQ: Function . play() in jQuery
Test scenario I have a page with the following elements: <audio id="aud1" src="audio/1.ogg" type="audio/ogg"></audio> <audio id="aud2" src="audio/2.ogg"…
-
4
votes2
answers60
viewsQ: Array of checkbox elements
Test scenario Dynamic form: function addReg(){ const template = $('#formX > div').last(); const novo = template.clone(); $(template).find('select').each(function(i) {…
-
5
votes4
answers110
viewsQ: Maintain select element value when cloning with jQuery and deleting Labels
Test scenario function addReg(){ var reg = $('#registro').clone().removeAttr('id'); reg.children('label').remove(); $('#formX').append(reg); } <link…
-
1
votes3
answers76
viewsQ: Doubt in the layout composition
Test scenario I would like a layout basically according to the image: What I already have is the "FIXED BAR" and the "TAB MENU". Details In the image in example, I will have a table in the green…
-
2
votes0
answers68
viewsQ: Download coming table of AJAX request return
Test scenario I have a page with input "start date" and "end date", and a "spreadsheet" button". The button calls the function planilha(). Function planilha(): function planilha() { var dados =…
-
1
votes1
answer46
viewsQ: Remove classes recursively
Test scenario I have a menu, with sub-items, where each sub-item is a link: <ul id="MenuTabs" class="nav nav-tabs justify-content-center"> <li class="nav-item"> <a id="TabInfo"…
-
0
votes1
answer343
viewsQ: Page and data redirection with Ajax
Test scenario I have a page from login.php, that checks the user and password with ajax, sending the data via post to the file valida.php. The valida.php, when the authentication works, should…
-
4
votes4
answers190
viewsA: Divide a sentence into 2
Dude, it should be simpler. But I think it works. I didn’t test it 'cause there’s no way now. $frase = "Nome do produto teste cadastrado"; function divide($frase) { $quebra = explode(" ", $frase);…
-
2
votes3
answers40
viewsA: Printing only the last result
First of all your loop is wrong, because it is placing the whole page structure inside the repetition, so you would generate several "pages" in a single. Then, as done by Marty, one should only…
-
2
votes3
answers1491
viewsA: ORDER BY ASC and DESC at the same time
Test like this, if it works out I’ll comment on the answer. SELECT * FROM ( SELECT mc.competencia, (CASE WHEN (COALESCE(mc.valor_pago, 0.0) = COALESCE(mc.valor_devido, 0.0)) THEN 'success' WHEN…