Questions tagged as 'sql'

1
answer

Updating hierarchical data using hierarchyId

Hello. I have the following table in SQL Server 2008 The goal is to update the Value field on a child and accumulate on the parent. For example: If in the record of id 12 I put the value 31 in the value field, its direct parent (8) should...
asked by 08.07.2015 / 23:23
1
answer

How to search for similar words or synonyms in PostgreSQL

I need to make a search return similar words to me I found the phonetic search it can even be used to refine the search I need, but I do not think that is ideal. For example, in a database I have several professionals, but your professio...
asked by 26.05.2015 / 00:54
2
answers

Turning Number Sequence into Date with PHP and SQL

I have a database that has a numeric sequence written to a table that means a date of publication of an article. I would like to know if anyone can decipher this number sequence so I can print the correct date through PHP. For example: 14...
asked by 22.06.2016 / 16:55
2
answers

HTML and SQL connection [closed]

I'm designing a database with where I have a table with calculated indexes of data from other tables. I'm also designing an HTML dashboard to expose these indexes. My database is stored on a MySQL server. How do I extract this data and expose it...
asked by 31.07.2017 / 04:20
3
answers

Select the line with the largest ID [duplicate]

I have the val_products table, where product id and product_value , I need to give a select * only on the line whose ID is the largest, for example I have two products with ID's 1 and 2, but I need to return in that select only the line wit...
asked by 03.01.2018 / 20:02
3
answers

Remove last number with sql

I would like to remove the last number or 1 in this sequence: 0495747500000049908275289000100040000000041 How do I do in sql server?     
asked by 04.09.2018 / 22:42
3
answers

Is it possible to use if else in MySQL queries?

I've been researching the internet and hearing rumors that it's possible to use if else in MySQL queries but have not seen anything concrete about it. Is it really possible? If so, how? I want to make a query in three distinct tables i...
asked by 15.06.2016 / 00:38
1
answer

Best approach is to filter data in the database or application?

Suppose we have a 'Vendas' table with the following 'estado', 'cidade', 'vendedor', 'valor' columns. 'estado' and 'cidade' would be where the sale was made and 'vendedor' would be what made that sale. 'v...
asked by 07.06.2017 / 19:45
3
answers

Searching for data in the database

Good evening, I'm doubtful in a certain code. It should fetch all users from the database and list ... but the error ... Here is the snippet of the code where I make the instructions to fetch the data: <?php session_start(); include "...
asked by 18.07.2017 / 03:05
2
answers

What is a DataSet and what is its function?

Creating my first applications with a database (SQL Server), I make the connection by passing my string and using the SQLCommand class to pass the query. But by searching other sites, I see that access to the database is done via DataSet....
asked by 16.03.2018 / 18:47