I have a query like this:
SELECT COUNT(*) AS amount
FROM daily_individual_tracking
WHERE sales = 'YES'
AND daily_individual_tracking_date BETWEEN '2010-01-01' AND '2010-03-31'
I am selected from a date range. Is there a way to also get the total days in the date range?
Ok, So I have to generate very complex reports from my DB.
If I am to do it with SQL the query themselves will be complex, and I will have to do some more manipulation on the results later, code level.
How do libraries like Jasper Reports/ Crystal Reports and friends save me time when developing such reports?
What will they give me?
I am getting data from a query and processing it using Javascript in the xaction file.
Now I want to pass the processed data (a 2D array) down to a prpt where it will be used to generate graph and table.
What is the format in which Javascript would generate the data and how is it passed to and received by the prpt file from the xaction.
Thanks...
I would like to get a list of well-known buildings(museums, castles etc..) within X meters radius of the current coordinate. I would like to query them in PHP.
Do you know any such database that can be queried?
Hi,
I query "content//sms/" and don't know what some fields are. They are -
Thread ID
Protocol
Status
Reply_Path_Present
Service_Center
I check them in LogCat. I find them like below
Thread ID : 1 to 6 etc..
Protocol : null / 0
Status : -1
Reply_Path_Present : null / 0
Service_Center : null
Please tell me what they are.
Hello.
Recently i found that SQLite don't support DISTINCT ON() clause that seems postgresql-specific. For exeample, if i have table t with columns a and b. And i want to select all items with distinct b. Is the following query the only one and correct way to do so in SQLite?
select * from t where b in (select distinct b from t)
How is it possible for sizeof(class) to return two different values depending on context? The class itself should have the same size right irrespective of where I ask this question? I see a smaller value when querying class size from main() and another when I query class size from an extended class.
Hi,
My application is completely navigation based and my query is that navigation based application can switch to any mode i mean orientation to portrait to landscape.
Please help me out
Thanks in advance
Dears ,
I have a prolblem in my SQL SERVER 2000 ,
the server is so slow when i made any query
and recently i couldn't link with other sql servers
the message is "the server dosen't exists or access id denied"
in spite of that the linked servers were working well and i can access them remotly & the service pack is SP4...
any body can help ..
thanks again.
I have an entity with many-to-one mapping. (Product 1-* Regions, unidirectional association)
What is the best way to store index of such relation?
So it can be easily used to filter search query .
I want to get file size I'm doing this:
my $filename=$query->param("upload_file");
my $filesize = (-s $filename);
print "Size: $filesize ";`
Yet it is not working. Note that I did not upload the file. I want to check its size before uploading it. So to limit it to max of 1 MB.
I am using mysql_fetch_assoc($query), one of the bit field returns out to be , which is supposedly to be true.
The problem is that I also need to output this to xml and it's an illegal xml character.
the charset for the db table is utf-8. why does this happen?
Hi,
I use codeigniter's database abstarction, and im doing a transaction with it. My problem is, that i have several inserts into several tables, but i need the insert id from the first insert query. Is there any way to store the last insert id for more than one following insert?
I need a link for each depotname that will bring up a child window with the details of the last 10 backup status.
while($data=mysql_fetch_array($res))
{
if(is_null($depot_array) || !in_array($data['depotname'],$depot_array ))
{
$depot_array[$r]=$data['depotname'];
if($data['SCP_status'] <> 'success')
{
echo "<tr id='fail'>";
The results of the following query should be displayed in a child window.
select * from backup_log where depotname = $data['depotname']
I was trying to run the following query
UPDATE blog_post SET `thumbnail_present`=0, `thumbnail_size`=0, `thumbnail_data`=''
WHERE `blog_post` NOT IN (
SELECT `blog_post`
FROM blog_post
ORDER BY `blog_post` DESC
LIMIT 10)
But Mysql doesn't allow 'LIMIT' in an 'IN' subquery.
I think I can make a select to count the table rows and then make an ordered update limited by 'COUNT - 10', but I was wondering if there is a better way.
Thanks in advance.
Please could you let me know if there are any performance issues with using mysql on windows xp. The mysql serves over 10 client server apps, which query the database simultaneously
Hi all,
I have a query factory that takes a column name as an attribute in order to search for that column. Right now I'm passing the name of the column as a string, so it's kind of hardcoded. If the name of the column changes in the entity's annotation, that "hidden dependency" breaks up.
Is there a way in jpa to retrieve the real name of the column and have it available at compile time, so I can use it in queries?
Hi,
I need to sort query results by the output of some function which takes "score" and couple other fields as an input (50% of the total score comes from similarity score and 50% comes from document's popularity). Is there a way to do this without having to install "Sort by Function" patch?
Thanks!
Hello, I have to migrate this query (simplified here) from T-SQL to ORACLE
SET IDENTITY_INSERT table ON
INSERT INTO table (id, value) VALUES (1, 2)
SET IDENTITY_INSERT table OFF
id being an Identity field in SQLServer.
I have the same table with a sequence in ORACLE, I couldn't find a snippet that shows how to disable the sequence and set it to start again with the MAX(id) + 1.
Any ORACLE expert can help me with this?
Thanks,
Rodrigo.
I'm using Doctrine 2 with my Zend Framework application and a typical query result could yield a million (or more) search results.
I want to use Zend_Paginator in line with this result set. However, I don't want to return all the results as an array and use the Array adapter as this would be inefficient, instead I would like to supply the paginator the total amount of rows then and array of results based on limit/offset amounts.
Is this doable using the Array adapter or would I need to create my own pagination adapter?
Let's say we have a [Valuations] table containing several values per date and per fund:
-FundId
-ValDate
-Value1
-Value2...
The Primary key is obviously FundId+ValDate.
I have also indexed the ValDate field since I often query for values on a specific date.
My question is: should I also create a specific index for the FundId, or is MsAccess clever enough to use the Primary key when querying on a specific FundId ?
Hi,
I have a query related to Touch events on the UI controls.
I have 4 controls on the screen ( UITextField, UISlider, UISwitch, UIButton ). If the user touches any of the control on the screen, I want to fire touchesBegan and touchesEnded events on those controls in which I would implement some code.
Please let me know how to fire these events.
Thanks in advance,
Sreelatha.
I have a ResultSet object containing all the rows returned from an sql query.
I want to be able to (in the java code, NOT force it in the SQL) to be able to take a ResultSet and transform it so that it only contains 1 (the first) row.
What would be the way to acheive this? Also, is there another appropriate class (somewhere in java.sql or elsewhere) for storing just a single row rather than trimming my ResultSet?
Thanks!
Is there a way to keep the order when using SELECT WHERE IN()? For example, using the following query:
SELECT id FROM data_table WHERE id IN(56,55,54,1,7);
The results will come back using the default order by id. 1,7,54,55,56
When I want to keep the order used in the IN: 56,55,54,1,7
Is there a quick way to do this in mySQL or will I be forced to order it after in code.
Thanks :)