Questions tagged as 'sql'

2
answers

REMOVE zeros from a number

Good afternoon I'm new to sql programming and I've been researching how to remove zeros at my rates, for example I have rates in the same column 0.7550 100.00 but in my report I do not want to show decimals 00 on the right side and only show 0.7...
asked by 11.12.2018 / 20:05
1
answer

How to send a parameter in a LIKE query

My problem is that I'm doing a form, and I have a txt that is responsible for searching, but I have to put the manual data in the query to work, and what I want is to take the value of txt to search from here: I leave the code in summary View...
asked by 10.12.2018 / 19:51
2
answers

SQL query - Count with date

Hi, I have a problem with a query in bdd (sql) and it is as follows: how to show how many times from the date of birth (date X) until today (sysdate), it has fallen Saturday (day x of the week) ., thank you in advance.     
asked by 28.03.2017 / 00:48
1
answer

Exports table from a database from PHP with SQL format

Greetings I tried to export a table from a database from PHP but I think I'm not using the correct extension. Please explain and thank you in advance.     
asked by 03.03.2018 / 06:47
3
answers

Prevent deleting more than one record at a time with a trigger in Oracle

I need to implement something similar to what SQLServer does but in Oracle: CODE: SQLSERVER CREATE TRIGGER TR_ImpideBorradoMultiple ON MiTabla AFTER DELETE AS BEGIN IF(SELECT COUNT(*) FROM Deleted) > 1 Begin raiserror('Pr...
asked by 21.07.2017 / 14:43
1
answer

how to query 3 tables with different characters in Mysql

good evening someone can help me telling me how to make this query please show the number of people who live in "Germany" and who study "Frances" my tables are estudiantes -id -nombre -idpais -ididioma pais -idpais -pais idioma -id...
asked by 29.10.2018 / 03:50
1
answer

Multiple foreign keys within a field of another table?

Good morning, I am developing an Android application where I have this database. -Tables Food: ID Primary Key char (15) Name char (25) Description char (35) Tags char (35) -Tables Tags: ID Primary Key char (15) Name char (1...
asked by 06.06.2018 / 21:49
2
answers

Procedure to delete a table

I did a stored procedure to delete a table if it exists that is passed by parameter, this is my code: create procedure CrearTabla @Tabla varchar (100) as if OBJECT_NAME(@tabla) is not null begin drop table @tabla end go But it...
asked by 06.11.2018 / 19:40
1
answer

Export result of a select to a text file [closed]

I have a SELECT in SQL Server and I want to export it to a text file (result.txt), I can see that it can be done with some programming language, but I want to do it with TSQL. If it is possible?     
asked by 28.11.2017 / 22:23
2
answers

Pass minutes in int format to HH: MM SQL format

I'm turning trying to pass an entire value to hh:mm format. So far I managed to do /60 , passing the rest to minutes and casting everything in string format so that I keep the : in the middle. But I would need it to be i...
asked by 16.02.2017 / 14:33