Hi, I'm here again-
I have something like this
Select A.a, A.b, A.a+A.b as c, (A.a+A.b*2)+A.d as d from Table
But i want to know, if it is possible, to make it work with something like this:
Select A.a,A.b,A.a+A.b as c, (c*2)+A.d as d from Table
Thank you
i have a very simple report that is generated from just one table. one of the columns in the table is a date.
i need to be able to allow the user of the report to enter a range of dates and display data only between those dates.
how do i do this?
Hi
I have a table with the following structure:
id int(11),
name varchar(250)
I have lots of records in the table but when I am trying to find a particluar record which has the following value on the name field:
Lorem ipsum d\'olor sit amet
The query is simply returning a blank recordset. I am not being able to figure out this weird behaviour, when my query is as simple as follows:
SELECT * FROM slot_games WHERE name='Lorem ipsum d\'olor sit amet'
Would appreciate your help please! Thanks in advance.
I have a MySQL table with a column called "priority". The column can have two values: high or low. I want to select 8 records from the table at random, but I want 6 of them to be high priority, and 2 of them to be low priority. If possibly, I would like to do it in one SQL statement. Is there any way to do two LIMITS in one query based on this kind of criteria?
hello !
languages table(languagename,languagecode(pk),part);
parts table(subjectype,part(pk));
I want to access only perticular subject type into drop downs...
How can i do this.
I need help with select statement in SQL Server / T-SQL
My table looks like this:
Id (int)
QuestionId (int)
GenreId (int)
I want to select random N rows from this table so that maximum number of same GenreId in the result set is less than X for all GenreId-s except one. For that one GenreId, I need row count with that GenreId to be equal to Y.
Hello
I am creating app where user can save options
witch one is better?
to save into user table varchar feeld smthing like ('1,23,4354,34,3')
query for this is select * from data where CHARINDEX ( 'L', Providers , 0 ) 0
create other table where user options are and just add rows
select * from data where Providers in (select Providers from userdata where userid=100)
thanks for help
Assume a Cassandra datastore with 20 rows, with row keys named "r1" .. "r20".
Questions:
How do I fetch the row keys of the first ten rows (r1 to r10)?
How do I fetch the row keys of the next ten rows (r11 to r20)?
I'm looking for the Cassandra analogy to:
SELECT row_key FROM table LIMIT 0, 10;
SELECT row_key FROM table LIMIT 10, 10;
i have user table, i have 5 records ,
i delete two records , then executed the rollback command, rollback command executed successfully.
But that deleted two records not recovered ,
user table engine is innodb...
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 values).
It seems simple but I can't seem to get my head around it because I can't use a SELECT subquery with an UPDATE to the same table.
Anyone?
Thanks
I have two database say DB_A and DB_B. In DB_A database, table having huge data (few tables are having 2 to 10 million data). I want to move the all table data from DB_A to DB_B database. Please help me on writing stored procedures to move efficiently (fast) the data from one database to another.
How to add a custom value using LOAD DATA LOCAL INFILE?
The column time_added is the 7th column and the file has only 2 values for the first and the second column. For the 7th column, time_added I want to use the unix timestamp when loading from file.
This code isn't working:
$result = mysql_query("LOAD DATA LOCAL INFILE '{$myFile}' INTO TABLE {$table} FIELDS TERMINATED BY ':' LINES TERMINATED BY '\n' SET `time_added`=unix_timestamp()");
Is there a simple way to see if the xsd code generating C# code has a particular column? Or if you can reference a variable column? table.getColumn("column") instead of table.column?
I have problem in generate report. I use crystal report 8.5 with vb.net 2008,what I want is when I generate report it will appear red value, if the value is more or less than actual value else it will give default value but when I put this code it give me wrong result
If {Intake.wheatType} = {Spec.WheatType} AND
{Intake.HB43} >={Spec.M_Min} AND{Intake.HB43} >={Spec.M_Max} Then
Red
Else
DefaultAttribute
this report is related with two tables, which is table Spec and table Intake. Could anyone help/teach me how to fix this problem
I have a table which I want to record the timestamp of every order at every insertion time. However, I'm getting zero values for the timestamps.
Here's my schema:
CREATE TABLE IF NOT EXISTS orders(
order_no VARCHAR(16) NOT NULL,
volunteer_id VARCHAR(16) NOT NULL,
date TIMESTAMP DEFAULT NOW(),
PRIMARY KEY (order_no),
FOREIGN KEY (volunteer_id) REFERENCES volunteer(id)
ON UPDATE CASCADE ON DELETE CASCADE)
I'm building an app which will allow a user to scan the barcode on a 'shelf', 'box' or 'product' which will then bring up that particular item or all the associated items.
As these are all separate models with their own ID's, I need a global ID table.
I was thinking of a polymorphic table called 'barcodes'
barcodes
id
barcode_number
barcodable
Is there an easy way to do this? Or is polymorphic the best way?
If I want to see which values from an Excel spreadsheet column don't match values in a table, I can easily create a table with Bulk Import. Is there a simpler way?
EG, I want to do a query like:
select into #temp from ('a', 'b', 'c') as 'Id'
select * from #temp where Id not in (select Id from MyTable)
I'm trying to use a regular expression as below:
preg_match_all('|<table.*</table>|',$html,$matches, PREG_SET_ORDER);
But this is not working, and I think the problem is the new line inside the string $html.
Could someone tell me a work around?
This is what I'm doing right now:
Execute a query and check if the date
to be inserted already exists in a
table.
If date doesn't exist:
Another query will insert the date into the table.
How can these two query be combined?
I'm looking for an example of a good update trigger to update the ModifyDate field of a table.
It would be nice to handle the case where an update command updated more than one record in the table.
Is there a good template or tutorial for this?
Thanks
Is there a simple :) and efficient way or reading very large number of rows sequentially using Zend_Db?
Basically I need to process entire table, row by row. Table is large, primary key sequence is not guaranteed(i.e. not an autoincrement, but is UNSIGNED INT).
What's the best way to approach this?
Environment: PHP 5.2, Zend Framework 1.10, MySQL 5.1
This code gets the text that's in a certain column of a table row:
var keyA = $(a).children('td').eq(column).text().toUpperCase();
Q: How do I rewrite this to get the value of an input tag that's in the table cell?
var keyA = $(a).children('td').eq(column).('input').val().toUpperCase();
Hi,
I am planning to get a report for a table with following table structure:
ID RequestDate
-----------------------------
1 2010/01/01
2 2010/02/14
3 2010/03/20
4 2010/01/07
5 2009/03/31
I want the results as:
I
D_Count RequestDate Sum
-----------------------------------------
2 2010/01 2
1 2010/02 3
2 2010/03 5
Pls help.