I want to calculate the Sum of the Field which has Time DataType.
My Table is Below:
TableA:
TotalTime
-------------
12:18:00
12:18:00
Here I want to sum the two time fields.
I tried the below Query
SELECT CAST(
DATEADD(MS, SUM(DATEDIFF(MS, '00:00:00.000',
…
Hi, does anyone know of an API or where I could get hold of data/script to create a <select> drop down lists for occupation and job type?
Regards,
Phil
I have a table company which holds the company_id, company_name and other details.
I have a table subcontracts which has a company_id column that maps to company.company_id.
How can I write a select statement to get all companies which have not been assigned to a subcontract? IE The company_id cannot be found in subcontracts.company_id
i have a form that auto populates input fields using jquery and ajax i can not get the img url to change in the img src when i select the option from dropdown
my dropdown is dynamicaly populated here is is my function
<script type="text/javascript">
$(document).ready(function(){
$("#id").change(function(){
$.ajax({
…
I am programming on windows, I store my infors into sqlite.
However I find to get all items is a bit slow.
I am using the following way:
select * from XXX;
retriving all items in 1.7M SQLite DB takes about 200-400ms,
It is too slow. Can Anyone Help!
Many Thanks!
Hi,
It is probably pretty simple but I cannot figure it out: Say I have tables A and B both with the same columns. I need to do SELECT * FROM A,B without having results merged into one row.
I.e. when each table has 2 rows, I need the result to have 4 rows.
EDIT: I know about JOIN but dont know how to join the tables without predicate. I need…
I have a database table that stores user comments:
comments(id, user_id, created_at)
I want to get from it the number of users that have commented for the first time in the past week.
Here's what I have so far:
SELECT COUNT(DISTINCT `user_id`)
FROM `comments`
WHERE `created_at` BETWEEN DATE_SUB(NOW(), INTERVAL 7 DAY) AND NOW()
…
I have a question about the snippet below. I'm wondering, if the first query doesn't bring any results, would I still get the results for the second query?
select *
from
(
-- first query
) as query1
left join
(
-- second query
) as query2
on query1.id=query2.id
left join
(
-- third query
) as query3
on query1.id=query3.id;
…
Hi! This query that I have is returning therapists whose 'therapistTable.activated' is equal to false as well as those set to true! so it's basically selecting all of the db, any advice would be appreciated!
` $query = "SELECT
therapistTable.*
FROM
therapistTable
…
Hi,
I'm trying to display all orders placed and I have a primary accessdatasource control that has a select query to get the customer information and the orderID. I want to use the orderID value from this first query as a parameter for the secondary accessdatasource control that selects the product information of the products in…
I have a scenario where I'm calculating something in the WHERE clause of my SQL, but I also want to get that calculation - since it's expensive. Is it possible to get the results of something done in the WHERE clause, like this:
SELECT `foo` FROM `table` WHERE (foo = LongCalculation())
Wishful thinking, or possible with MySQL?
Consider i have a registartion table and there is field prefLocationId and it contains value like this 1,2,3,2,1,4 and so many.... And i have a table prefLocation which looks like this
Id LocationName
1 Chennai
2 Mumbai
3 Kolkatta
4 Delhi
and i want to select record of users and show values like
…
I was to have some extra information in the callback to sa_sigaction handler, it does not seems possible.
So I was wondering if you could suggest me alternatives. Basic requirements:
Function A raises an signal/event with a pointer to a struct
Handler function tackles the event.
The handler function…
I have a select statement, retrieve about 1000 record
I want to modify it to return only some records defined by @startIndex and @count
e.g. : If I said @startIndex=20 and @count=20
the result will be : from the 21th record to 40th
I try to make it, but it take the same time as if I retrieve the 1000…
Is it possible to have a bunch of <select> dropdowns in html that only display a small (say 10 pixels wide) icon, but when you click it the drop down has a list with the icons beside a descriptive string. (Let's see if ASCII art works on SO):
[X]
| X - Disable |
| v/ - Enable |
| O - Ignore |…
I have a query that gets a list of emails who have subscribed for a newsletter trial which lasts 30 days..
$thirty = time() - 3024000;
SELECT c.email FROM tbl_clients AS c JOIN tbl_clientoptions AS o ON o.client = c.id WHERE o.option = 'newsletter' AND c.datecreated $thirty
What I want to do is do…
Hi,
I'm trying to a create an update statement along the following lines:
TABLE car: id | owner_id | type | status
An owner can have multiple cars.
UPDATE car c
SET c.type = 1
WHERE c.owner_id IN ($ids)
AND c.status = [1 IF IT EXISTS, ELSE 0]
$ids is reasonably small (under 50…
Hi,
i want to show a select which options are the character '-' and a range of integers.
I have this:
$years = range(14,130);
new sfWidgetFormChoice(array('choices' =>
array_merge(array('' => '-',array_combine($years,$years)));
The problem: between the '-' and the range of…
I am trying to fetch records based on two dates from sql server...
Select * from table where CreatedDate between @StartDate and @EndDate and i pass 5/12/2010 and 5/12/2010 (ie) fetching records for today... I have 17 records dated 5/12/2010 but none seems to get selected....
EDIT:
I use this…
There are many excellent guides out there that explain how to dual-boot Windows 7 & 8. However, they are written for people starting with a Windows 7 installation and add a Windows 8 installation to separate partition.
From what I'm reading, following this procedure will result in…
I have a full screen AS3 game maby with Adobe AIR that runs in Windows 7.
In this game it may not be easy to exit (think about kiosk mode, only exit by pressing esc and enter a password).
Now I want this game to run in Windows 8. The game is working like expected but the anoying…
I have a template for an email that I've put in a localized strings file, and I'm loading the string with the NSLocalizedString macro.
I'd rather not make each line its own string with a unique key. In Objective-C, I can create a human-readable multiline string like so:
…