Questions tagged as 'sql'

2
answers

How to create a table from C #?

I have an application in C # which I made a button, to create a table in my new sqlexpress I have seen some codes but I have no idea where I should declare them (I imagine that in my "create" button), and the next problem I see is to give my...
asked by 26.01.2018 / 09:39
0
answers

Create table with Fk

I'm having trouble creating a table with several Foreign keys The tables are the following CREATE TABLE tbl_Autor( nAutorID INT AUTO_INCREMENT PRIMARY KEY NOT NULL UNIQUE, cNombre VARCHAR(20), cApellidos VARCHAR(50) ); CREATE TABLE tbl_Li...
asked by 27.01.2018 / 20:08
1
answer

Add SQL rows

Hi, I have the following problem, I want to add rows of the following query: SELECT AreaName,CASE WHEN datename(WEEKDAY,DateOpen)= 'Sunday' THEN DATEPART(MINUTE, CONVERT(Datetime,MTTA)) END Domingo, CASE WHEN datename(WEEKDAY...
asked by 26.01.2018 / 16:54
0
answers

ERROR syntax error, unexpected '& quot; pr_employees.doctype_id, pr_e' (T_CONSTANT_ENCAPSED_STRING)

Good evening I have the following query in phalcon and I get this error: Parse error: syntax error, unexpected '"pr_employees.doctype_id, pr_e' (T_CONSTANT_ENCAPSED_STRING) in /var/www/html/apiabacus/app/controllers/EmployeesController.php on...
asked by 23.01.2018 / 04:21
0
answers

Change type of column SQL server

Is there any way to change the type of column in an SQL server? I have seen this but it does not work because it does not save it correctly link The problem that I have is that all the text changes keep them as char, so when I select...
asked by 23.01.2018 / 10:47
1
answer

Generate report in txt with query in SQL Server from PHP

From the following function queryMonth I want to generate the results of the query in a TXT. queryMonth function: public function queryMonth($fecha1,$fecha2) { $res = array(); $rowres = ""; $stmt = sqlsrv_query( $this->conn,"with ct...
asked by 23.01.2018 / 23:14
0
answers

Complex query in Phalcon (INNER JOIN) of 6 tables

Good morning. My question is about how to pass a query made in SQL to Phalcon . This is my query: SELECT pr_employees.doctype_id, pr_employees.id, pr_employees.last_name, pr_employees.last_name2, pr_employees.name, pr_employees.bod, pr_em...
asked by 22.01.2018 / 16:28
1
answer

Change the structure of a table in MySQL

In this case I will use ALTER TABLE to take the AUTO_INCREMENT to zero (0) . The goal is to bring the table to 0 without having to delete it and create a new one. To do this we just have to write the following order: ALTER TABLE 'nombr...
asked by 20.01.2018 / 18:31
0
answers

Problem so that a user does not exit in OneToMany query if a condition occurs

I have a problem with an sql query that I am doing using doctrine in symfony I have two related tables, one of users and one of actions performed by the user, these tables are related from one to many, a user can do many actions. I am trying...
asked by 21.01.2018 / 20:33
1
answer

SQL problem with distinct and count

I have two tables, the first call question_tags_g3 and the second questions_g3. In the question_tags_g3 table the tag field contains programming languages and some are repeated many times, and when executing this statement: select a.tag, count...
asked by 17.01.2018 / 14:38