nodeJs , run sql twice can combine them to json

SQL
I am building the api by using node js. here is my code var keyword = req.body.keyword; var sql = "SELECT xxxx WHERE xxx"; connection.query(sql,fun...
3 years ago

How can I have NHibernate only generate the SQL without executing it?

SQL
I know how to log the SQL to log4net/NLog/trace window at runtime with the show_sql configuration option. What I'm looking for is a way to give a Que...
3 years ago

SQL Server SELECT replace with second table

SQL
I'm trying to replace words to '****' when a specific word is listed in a second table. Can someone help me? ...
3 years ago

View Expansion in Oracle

SQL
So we have some developers who went a little view happy. So now we have views that reference views that reference views, ad nauseum. So what I want,...
3 years ago

Use Environment.Tickcount to determine how long a computer has been on

SQL
I have been working a on a project in which i need a rough idea of how long a computer has been on. To this end i have this code. TimeSpan.FromMil...
3 years ago

Send form data to database

SQL
I want to collect user input from a form and send it to a database. I don't know how to tell sqlCmd.Parameters.Add to use the x, y and result integers...
3 years ago

Write a query using sakila databse

SQL
I am writing a query to give actor id, first name, and last name for all actors who have never appeared in a film rated ‘PG’. Here is what I've done....
3 years ago

insert variable into database using php

SQL
2000-10-01,2000-12-16,2000-11-17,2001-03-10,2001-09-10,2000-09-02,2000-11-02,2000-12-06,2000-11-02,2000-12-09,2000-12-01,2001-04-16. Gambardel...
3 years ago

How to get a random model with at least N related of multiple `hasmany` models

SQL
I am trying to combine two features: - getting a random model - ... but only if it has at least 1 related model my URL is entity/random and the below...
3 years ago

How to update incrementally the data into another table using loops

SQL
I have one query which is like this CREATE TABLE #Employee (Id INT, Name NVARCHAR(100), Status TINYINT) GO INSERT INTO #Employee ( Id, Name, Status)...
3 years ago

Count number of rows for specific ID

SQL
In first table album has id and second table album_details has sub_id which relates from album table id I need to display count for separate id v...
3 years ago

How can I resolve an invalid identifier on an Oracle DB query result?

SQL
I am new to Oracle DB and I need to list the number of departments per region in the region table. This is my SQL statement: SELECT r.region_id, COU...
3 years ago

DB2 update column with incrementing number based on distinct values in another column

SQL
For each distinct ref_no value, I want to update the seq_no column with a running sequence of incrementing values starting from 1. REF_NO SEQ_NO (in...
3 years ago

Oracle check multiple column combination values in another table

SQL
Here's one I've been working on for a while. I have a query which pulls data as expected... SELECT a.plant, SUBSTR(a.completed_ts, 1, 4) wo_ye...
3 years ago

REGEXP '*' Doesn't work

SQL
I'm working on some project using mySql's REGEXP, the idea is to insert a value that will much some criteria in the database for each user and then us...
3 years ago

fetch and find frquency count of generalized zipcode

SQL
I have table as below ID NAME AGE ZIPCODE 1 A 29 321345 2 B 25 321375 .... and so on about 40K records. I want to fetch distinct zipco...
3 years ago

Want a select query where database data represented as column name

SQL
I have a database table named as sales. | ID | Group | Month | Amt | ____________________________________ 1 | Y | Dec-2015 | 300 ___...
3 years ago

Mysql - when trying to UPDATE a timestamp column. It fails to update

SQL
I think I may have encountered a bug in mysql, or is it just me doing it wrong. I've been using the same specific queries for the last four months an...
3 years ago

sql left join with condition

SQL
I have this problem with SQLite in Android: From items I should get: 1) all items with title field containing a string . example '%sho%' 2) check i...
3 years ago

How to escape apostrophe (') in MySql?

SQL
The MySQL documentation says that it should be \'. However, both scite and mysql shows that '' works. I saw that and it works. What should I do? ...
3 years ago