Category "sql"

How can I select rows where keeping only those that meet this criteria? sql/hive

I have a table like the following: +-------+------+ |ID |lang | +-------+------+ |1 |eng | |1 |pol | |2 |eng | |3 |gro | |

SSMS 2012: Convert DATETIME to Excel serial number

I can't seem to find an answer to this anywhere --- I want to convert a datetime in SQL to the excel serial number. I'm essentially looking for the DATEVALUE f

How to order results of a query by the results of an aggregate function in ComosDb?

I use Cosmos Db and I need results to be sorted by the results of a COUNT. Instead of sorting the results each time myself (or create a service for it), I pre

User defined table type with dynamic columns in SQL Server

In my .NET (C#) win application, I import an Excel file that contains multiple columns of varying numbers. So, I store the data in my datatable in code and I ne

SQL Query Error - Error Source: .Net SqlClient Data Provider

Error Message: The SELECT permissions was denied on the object 'quote', database 'oneview', schema 'dbo'. I am relatively new to SQL and the developer I am le

how to solve db2 code: -104, SQL State: 42601

--/ BEGIN FOR V AS MYCURSOR CURSOR FOR SELECT ID,NAME,AGE FROM PEOPLE DO BEGIN INSERT INTO PERSON(NAME,AGE) VALUES(V.NAME,V.AGE);

How to query database by id using SqlAlchemy?

I need to query a SQLAlchemy database by its id something similar to User.query.filter_by(username='peter') but for id. How do I do this? [Searching over Googl

Insert radio button selected value into database

I am building a C# Windows application with 2 radio buttons for gender. I'm using a simple insert query to insert data in the database. Can anyone help me wit

Easter / Good Friday for Sowflake Date Dim

Further Evolved : The code below satisfies what was wanted in earlier comments [if you follow history] :), my new question right below is stumping me. Question

How to one data file upload into multiple table by sql loader in oracle 10g example

Create table emp (id varchar2(22), name varchar2(85),hire_date date,department_id varchar2(3)); create table emp_epfo as select id emp_id,name lname,hire_dat

BigQuery sort a CONCAT of multiple string columns in SELECT

First I will present example of what I'm trying to achieve, and then will share a bit more info. This is a relatively straightforward task to explain, however I

Using a SELECT statement to return a row where a DateTime column = variable of type Date?

I am using OleDb, trying to do this: Dim d as Date = DateSerial(Year(rptDate), Month(rptDate), 1 - 1) Dim conn as OleDbConnection = new OleDbConnection(connSt

SQL Geography point inside polygon not returning true on STIntersect (but returns true using Geometry)

I don't want to resort in converting my geography data to geometry just so it returns true in STIntersect. Here is the code in SQL: DECLARE @point GEOGRAPHY =

postgresql: INSERT INTO ... (SELECT * ...)

I'm not sure if its standard SQL: INSERT INTO tblA (SELECT id, time FROM tblB WHERE time > 1000) What I'm looking for is: what if tblA and

SQL Geography point inside polygon not returning true on STIntersect (but returns true using Geometry)

I don't want to resort in converting my geography data to geometry just so it returns true in STIntersect. Here is the code in SQL: DECLARE @point GEOGRAPHY =

Impossible to add a User-Defined-Data Type parameter to my query

I'm trying to use a User-Defined-Data Type with C# and SQL Server 2008 but I have an exception raised when command.ExecuteReader() is executed. string qyery

Dynamic Column Name for a Derived Column - ORACLE SQL

I'm trying to set a dynamic column name on my query using "select from dual". Is this possible? If not, kindly recommend alternatives for me to achieve this. I

Dynamics NAV SQL Lead Time format conversion

I have a small issue getting data, one field in particular, from table replicated from Microsoft Dynamics NAV. There is a field storing lead time in strange fo

Python BeautifulSoup Empty Rows in CSV File

I am working on a scraper to pull street names and zip codes from a site and all of that is working great and it builds a CSV file just fine for me. But when I

Database design, variable number of columns [closed]

I have a simple application in which users submit data into a table. There are currently 3 fields the user can pass values to at the moment.