Questions tagged as 'sql'

1
answer

Adding values from a table

I have the following query: $qrysel = "select * from won_auctions w left join registration r on w.userid=r.id where payment_date!='0000-00-00 00:00:00'"; This query will show a list of users of the won_auctions table and get the user name...
asked by 27.11.2017 / 12:22
2
answers

WHERE SQL Functions

I have the following query: $qrysel = "select * from won_auctions w left join registration r on w.userid=r.id where xxx; This query will show a list of users of the won_auctions table and get the user name in the registration table....
asked by 26.11.2017 / 14:45
1
answer

Pass object by Ajax

I would like to know how to get through a ajax request, to bring to my site a list of elements, where these elements are the lines of an sql query. For example, I have a table of employees. In the form, when the user chooses an area, they must f...
asked by 15.11.2017 / 02:29
1
answer

How to make a query bringing me the last value of a specific id

I'm trying to make a query through C # with MySQL, where it has two tables: Compra - > Table where you get the IdProduto and the Product Value. Abastecimento - > Table where the IdProduto will go and the P...
asked by 09.11.2017 / 18:53
2
answers

Select picking up previous line

What do I have to use in SQL SERVER 2008 to pick up the line before a certain closing. For example if in my where below if the alert is = 99 I want to know the alert and the speed before the alert. Speed Data Alerta 58 '...
asked by 30.10.2017 / 13:22
1
answer

Syntax error sql, # 1064

I'm trying to create a table, in my database in phpmyadmin. SQL CREATE TABLE IF NOT EXISTS 'chat' ( 'id' int(11) NOT NULL AUTO_INCREMENT, 'time' timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 'username' varchar(32) NOT NULL, 'text'...
asked by 11.12.2017 / 01:46
1
answer

How do I save the largest value in rowCount?

I want to save in a variable the largest value ever obtained by rowCount only I do not know how to do logic. Current query: $playeronline = $pdoG->prepare("SELECT login FROM u_hero WHERE login = 1"); $playeronline->execute(); $...
asked by 08.12.2017 / 23:31
1
answer

Change column names "id" of a sql return

I want to perform a SQL query and change the name of the columns in the result because I have 3 columns id . Currently my SQL looks like this: SELECT * FROM shopweb_tipo as st INNER JOIN shopweb_categoria AS sc INNER JOIN shopweb...
asked by 08.12.2017 / 18:03
2
answers

Insert into with select [closed]

I need to do an insert of type INSERT INTO your_table SELECT * FROM temp_table; But, I need the id, and the second column that is an id_fk I can set. I need to do a transfer of the tuple to another user, copying all information but passi...
asked by 01.11.2017 / 19:31
1
answer

List 2 Tables in a Oriented Object

I have an academic job. and I'm not listing the DB data, or this is giving the error java.lang.NullPointerException I searched for something similar I found, I saw some examples but the form they use and creating the same attributes within the P...
asked by 22.11.2017 / 12:13