Questions tagged as 'select'

1
answer

How to use CASE WHEN in an IN statement?

In a query I am collecting data on representatives, customers and vendors. Some representatives have salespeople, who in turn have customers. These cases are exceptional because the clients are linked directly to their representatives....
asked by 08.09.2016 / 14:47
3
answers

Delete Report with months reset

I have a query in which I take monthly deposited values, it takes everything that it has in the base and shows the months that were inserted in the database. I would like to do different would like it to also show the months that did not have...
asked by 08.11.2016 / 16:19
1
answer

How do I return the records between two values with the SQL Server Database?

Example of my table: My question is as follows ... In my news page highlight has to appear the 2 latest news and on the secondary news page have to appear the 2 other news following. Example: in the highlight the news that will appear are...
asked by 13.10.2016 / 23:40
1
answer

Hashbytes with different values when doing select and save with update

SELECT HASHBYTES('MD5','123') This select above returns me the following result: 0x202CB962AC59075B964B07152D234B70 But when I do an update to the table using the same hashbytes UPDATE USUARIOSLOGADOS SET TOKENSESSAO = HASHBYTES('...
asked by 17.08.2016 / 22:38
2
answers

fill select field when opening javascript / jquery page

Hi, I already received a lot of help when I needed a select field to fill in automatically in this post here: fill javascript / jquery select field It's working perfectly well, but now I need to open a page where the select field is already...
asked by 21.05.2016 / 00:07
2
answers

Select from all companies that have catalogs

I'm having a problem with a select in two tables that are returning the value twice. I have the companies table and table catalogs that are linked by company.id and catalogs.id_enterprise . When I make a select that has two...
asked by 18.05.2016 / 15:29
1
answer

Tuple of values using mysql procedure

I have a form where you have two fields, one service and another value, for each service the user has to put a value, after the user chooses, I consult the bank how many rows will return me with this filter. For the procedure I pass two paramete...
asked by 29.01.2016 / 19:35
1
answer

Select Nested MySQL

I'm trying to get the highest value from the smallest of a table, the query I'm trying to execute is as follows: SELECT district FROM (SELECT district, MIN(postal_code) FROM address WHERE postal_code != '' GROUP BY district) WH...
asked by 15.10.2015 / 00:17
2
answers

Select the country and bring the state

I have a code that is in Codeigniter . It has the page to register a user. This page asks him to enter the country and state he lives in. He needed it when selecting a country to come the states corresponding to that country. I found a Jav...
asked by 17.09.2015 / 14:32
2
answers

Search only a random part inside a code with select in mysql

The problem is as follows, I have the concatenated code, I need to see this concatenated code if part of it is in the table, ie by putting field 1 and field 2 > with PHP, before searching the table, a variable brings me this preprogrammed, I...
asked by 09.07.2015 / 01:04