Questions tagged as 'sql'

3
answers

Function contrary to TRIM

How to insert characters into a varchar field in MySQL? For example, in the update with trim vc you can remove certain characters from a field varchar ... but add? Example: update tabela set campo = TRIM(leading '11' from...
asked by 12.02.2016 / 12:59
1
answer

Querying RG in database ignoring scores

I have a mysql database where I need to make a comparison of registered RGs with another one provided by the user through an input, to see if the same RG is already registered in the database. The problem is that since you have records with s...
asked by 29.10.2014 / 22:02
3
answers

How to Query a Value in a Table

I'm new to the Sql language, and I wanted to show the name of all people who are from the RS region, how could I do that? create database uri default character set utf8 default collate utf8_general_ci; use uri; create table pessoas( id in...
asked by 27.04.2018 / 20:14
5
answers

Change return / Date (1386295200000) / to date format

I have a return of json that comes from SqlServer : /Date(1386295200000)/ How to convert to date format dd/mm/yyyy ?     
asked by 22.03.2018 / 20:12
1
answer

Is it possible to generate a script from a table, from an SQL command?

I would like to generate a script to create a table, from a SQL command so I could build a program that would be able to clone tables. I'm using SQL Server 2008 R2 and need to implement a table cloning routine, within an application written i...
asked by 13.10.2014 / 14:42
2
answers

The less you consult the better, right?

It is possible to vary the writing of the results, as an example below where I want to use. <table width="1000" align="center"> <tr> <td>&nbsp;NOTICIAS</td> <td>&nbsp;</td> <t...
asked by 04.04.2015 / 15:02
3
answers

The null value automatically changes to 0

I'm doing a vehicle registration, I need it to register that whenever a vehicle is registered to zero instead of the value null, I tried by default, but it does not record the information. I'm using SQL Server along with C # in visual studio....
asked by 28.08.2017 / 20:00
1
answer

Save a JSON in the bank vs. Relationship?

When I did not know much about the question of database structure and relationship between tables, I used JSON or comma-separated data in a particular field in any table in the database. In fact, I remember a specific case where I needed to r...
asked by 19.08.2015 / 19:15
2
answers

Logic to validate free time in agenda

Good evening! I've been stuck for a couple of days in the following situation, I'm not able to parameterize or create an expression that validates interval between dates, which works like this: In other words, if you already have a s...
asked by 17.11.2017 / 01:25
2
answers

How to execute the INSERT only if the record does not exist?

I would like to use something like this in SQlite insert into table (column) values ('')if not exist;     
asked by 10.12.2017 / 13:35