Given the date, 2009/04/30, in one of the rows I want to retrieve all dates <= 2009/04/30 and >= 2009/04/30. The sql statements are like this:
select dateColumn from someTable where dateColumn <= '2009/4/30'
select dateColumn from someTable where dateColumn >= '2009/4/30'
The above 2 statements run but the first statement returns all...
I have a user-defined SQL function that returns 1 or 0 and I want to call it from a column CHECK constraint.
...
I don't have enough "Stack Overflow fu" yet to have found a previous answer to this.
One of my apps has its data in a SQLite database and I've used the Apple SQLiteBooks sample as primary inspiration -- however, SQLiteBooks has only a single table and a single view. I've got multiple (related) tables accessed as distinct views in a tab ...
Hi,
Wonder if anyone can shed any light on a sql query I'm working with;
I have built this query;
SELECT SUM(TICKET_TYPE.PRICE) AS TOTALCINEMASALES, CINEMA.LOCATION, PERFORMANCE.PERFORMANCE_DATE
FROM RESERVATION, TICKET, TICKET_TYPE, CINEMA, PERFORMANCE
WHERE TICKET_TYPE.TICKET_TYPE_ID = TICKET.TICKET_TYPE_ID
AND TICKET....
How do i convert hh:mm:ss to hh:mm in sql server?
select Count(Page) as VisitingCount,Page,CONVERT(VARCHAR(8),Date, 108) from scr_SecuristLog
where Date between '2009-05-04 00:00:00' and '2009-05-06 14:58'
and [user] in(select USERNAME
from scr_CustomerAuthorities )
group by Page,Date order by [VisitingCount] asc...
How can I group by Time? I tried this, but it gives the error "Invalid column name 'Time'.":
select Count(Page) as VisitingCount, CONVERT(VARCHAR(5), Date, 108) as [Time]
from scr_SecuristLog
where Date between '2009-05-04 00:00:00' and '2009-05-06 14:58'
and [user] in (select USERNAME from scr_CustomerAuthorities)
group by [Tim...
In PL/SQL Developer v7.1.x, is there way way to ignore large data types in queries or the "Query Data" feature. For example: If you right click on table FOO, and select "Query Data" this will execute a SELECT * FROM FOO. If that table contains BLOB data the query will take a while to complete and temporarily lock up the application. T...
Strings are unbounded, but it seems every normal relational database requires that a column declare its maximum length. This seems to be a rather significant discrepancy and I'm curious how typical ORMs handle this.
Using a 'text' column type would theoretically give you much more string-like storage, but as I understand it text columns...
I am using CodeCharge Studio to finish a large PHP application. This question isn't really CCS related, but a bit more general. I have a web form that is supposed to allow CRUD capabilities with a certain SQL Server table, but the Inserts keep failing without throwing any errors. What would be the best way to debug this?
...
I have a need to access data in a MS SQL database from within in MySQL and would like to know my options. The data is held across various joined tables
Ideally I would like to mirror the database schema and data in MySQL so that it can be queried from within Wordpress.
The data is hotel information as seen here http://www.vrxstudios.co...
Hi,
I am using application builder and setting up select boxes to populate a query that spits out into a report below, I'm having a problem with one populating though, and I can't immediatly see why;
Here's how I'm referencing;
AND CINEMA.LOCATION = :pticketstown
this works fine and pulls in the choice from the select box which is...
I have worked with SQL for several years now, primarily MySQL/PhpMyAdmin, but also Oracle/iSqlPlus and PL/SQL lately. I have programmed in PHP, Java, ActionScript and more. I realise SQL isn't an imperative programming language like the others - but why do the error messages seem so much less specific in SQL? In other environments I'm po...
The following two queries are returning different results, to my surprise:
SELECT *
FROM foo
JOIN bar
ON bar.id=foo.bar_id
JOIN baz
ON baz.id=foo.baz_id
LEFT JOIN zig
ON zig.foo_id=foo.id;
and:
SELECT *
FROM foo
LEFT JOIN zig
ON zig.foo_id=foo.id
JOIN bar
...
I am having problems with SQL Server dropping a connection after I have dropped and re-created a given database and the next time I try to execute a command against a new connection on that same database, I get:
A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 - ...
Hi,
This is my problem: I need to store a lot of log messages and thought it would be smart to keep it in a SQLite3 database to be able to search and filter it easily.
I will display the log messages in a standard list widget (using wxWidgets). The list will have several columns and can be sorted and filtered by the user.
Now, I'm not...
Hello all,
I am trying to get the latest record inserted in a SQL table based on its CreatedDate. For instance, in the table below, I would like to get the third row.
A B C 2009-05-04 19:30:52.847
A B D 2009-05-04 19:30:55.050
A B E 2009-05-04 19:30:57.003
I have a working query, but I am wondering if there is better way to ac...
Hi,
How do I make SQL SERVER 2005 to ignore the backslash in the following search:
select [description] from MyTable where contains([description], '3/4 and bear')
It is blowing off on "/"!
...
This is probably a simple question, but I really don't know what I'm doing in Excel, so hopefully someone can help me out.
I've been given an Excel spreadsheet that has two relevant columns to my task. The first column is an "External ID", and the second column is an "Internal ID". I need to select a bunch of data out of our databases (...
Let's say I have a table:
SELECT SUM(quantity) AS items_sold_since_date,
product_ID
FROM Sales
WHERE order_date >= '01/01/09'
GROUP BY product_ID
This returns a list of products with the quantity sold since a particular date. Is there a way to select not only this sum, but ALSO the sum WITHOUT the where condition? I'd like...
I'm preforming an aggregate function on multiple records, which are grouped by a common ID. The problem is, I also want to export some other fields, which might be different within the grouped records, but I want to get those certain fields from one of the records (the first one, according to the query's ORDER BY).
Starting point exampl...