Questions tagged as 'sql'

1
answer

SQL checking data content

I'm doing a search system for my blog (it already looks for post category and tags). Is there any SQL command (or if SQL itself already does this) that makes it check all the contents of the data found in the table and return me? Ex: I put a...
asked by 20.11.2015 / 02:17
1
answer

Problems with NOLOCK, READ COMMITTED SNAPSHOT

I always see sqls mounted with WITH NOLOCK that say improve performance, but I also heard that NOLOCK is obsolete and what should be used now is READ COMMITTED SNAPSHOT, in this scenario my doubts are: 1 - NOLOCK even improves performance or...
asked by 10.01.2015 / 03:52
2
answers

Search the data of the last 7 days from the current date (2014-12-11 11:06:09)

After viewing the this question , the following question arose, which is, in case the date field is in the next format 2014-12-11 11:06:09, how can I return only the last 7 days?     
asked by 05.02.2015 / 19:41
1
answer

Error Restricting Dates in SQL Server

I get 3 bases that are mounted in different places, these bases come to me in text file (.txt) and I do the import to SQL Server. I'm doing a query in which I want to restrict the records only for the year 2014 but even putting Data >...
asked by 21.11.2014 / 13:43
1
answer

Firebird C # singleton pattern

I'm using the following function to connect to the database, I'm programming in C # in Visual Studio 2013. namespace WindowsFormsApplication1 { static class Conexao { private static String strConn = Properties.Settings.Default...
asked by 03.11.2015 / 15:23
1
answer

What is the best way to escape a string before inserting into the database. addslashes () or mysql_real_scape_string ()?

I am developing a project that involves passwords among other important information that I need to insert into the mysql database. My question is which option should I use to escape this data against sql injection. Right now I'm using a regul...
asked by 11.11.2015 / 14:16
1
answer

How to sort and filter queries between two tables?

I have two tables, one of posts and one of friends. In my script there is a feed area where I would like to display the latest posts from the logged-in user's friends. But instead of bringing the last posts in order, the result sorts the...
asked by 13.02.2015 / 05:56
2
answers

PHP and MySqli. Problem connecting to table

I'm following a toturial, everything looks the same. My problem is that I can not connect to the table. connect.php: <?php $db = new mysqli('127.0.0.1', 'user', 'pass', 'app'); if ($db -> connect_errno) { die ('Sorry...
asked by 23.06.2014 / 14:05
1
answer

How to use "Not Exists" in LINQ?

I'm trying to translate the query below into LINQ, but without success, can anyone help me? SELECT * FROM PESSOAL A WHERE NOT EXISTS ( SELECT Chapa FROM PRODUCAO B WHERE B.Chapa = A.Chapa AND B.Data='2014-09-02') AND A.Codsubord='CB...
asked by 10.09.2014 / 16:22
1
answer

Error comparing dates ORA-00932

I'm having a problem comparing 2 dates in oracle. I am using the case method to compare the dates and at the end this should return to my table a number, which in the case represents an age, however, I get p error reporting: PL / SQL: ORA-009...
asked by 21.07.2014 / 14:43