Questions tagged as 'sql'

3
answers

How to create a table (empty) from a selection of other tables?

EXAMPLE : I have two tables: table1 : with two columns product_id , product_name ; table2 : With three columns tag_name , product_id , tag_name I would like to create a table3 from a selection of table1 and table2 with...
asked by 09.12.2016 / 13:58
1
answer

Problem with BETWEEN between dates

I need a light for an issue, I have a data filtering system (search) where I have to search for two dates, Initial and Final. Since I have these two columns in the database, then when I execute the search I choose which column I want to filter....
asked by 19.04.2017 / 15:30
3
answers

Filter per parameter or all

I query the database using linq. I would like to filter the ID_LEAD column by the value of the filter "if there is an int (filter.code) or filter all over the world. Follow the example of how the procedure is in the bank WHERE ---- @ID_LE...
asked by 17.04.2017 / 21:52
1
answer

List records without reference in another table

I have three tables: - Customers - plans - services In the services table I have servico_A, servico_B and servico_C that are listed in the plans table. I need to list all clients that do not have a plan with service_C. Even thoug...
asked by 24.11.2016 / 14:46
1
answer

Error Code: 1215. Can not add foreign key constraint

Can anyone help me? I can not create this foreign key. Here is my code: CREATE DATABASE escola2; USE escola2; CREATE TABLE IF NOT EXISTS aluno ( matricula INT, nome VARCHAR(25), sobrenome VARCHAR(30), cod_curso VARCHA...
asked by 17.11.2016 / 13:11
2
answers

Doubt with mongodb test

I'm new to mongo with a query with select / query. I need to do a query that searches the base yoda and the collection configuracoes to return all documents that have the tipoRecibo key with the value equal to gps . I know I ha...
asked by 26.10.2016 / 00:51
4
answers

Return value in SQL Server query

I need this query to return 2 instead of A. TYPEUSUARY is of type varchar. Can someone tell me where the error is? USE DATABASE SELECT TIPOUSUARIO FROM TABLE UP (NOLOCK) WHERE TIPOUSUARIO = case TIPOU...
asked by 21.10.2016 / 14:21
2
answers

Codeigniter with Modal screen and Registration Response

I'm doing a registration of requests of call through a modal but I can not handle answer of the cadastre: "Successfully register" Controllerclass<?phpdefined('BASEPATH')ORexit('Nodirectscriptaccessallowed');classHomeextendsCI_Controller{f...
asked by 01.06.2016 / 20:01
2
answers

How can I use something similar to an IF in an SQL query

I'm applying a SQL q query on Oracle SQL Developer in multiple tables where Column of a view is null in some places and then I'll need to use values of Column and not% I know how to use the query IF very well. Home Can anyone hel...
asked by 03.06.2016 / 16:35
3
answers

Pagination in PHP

I made the pagination available in the code below, following an example here of the stack, but it does not work as I need it to: display a maximum of 5 records per page and thus create the other pages. This code counts all the records of the tab...
asked by 12.06.2017 / 18:26