I am Using Oracle 9i and I want to use continue statement or its equivalent in PL/SQL. So is there any keyword called "continue" in oracle 9i. If not, please let me know the solution for this.
is there a way to have a mysql select statement return fully qualified column names like "table.field" without using AS for every single field?
like so:
SELECT *
FROM table1
LEFT JOIN table2 on table1.f_ID = table2.ID
and the result would be:
"table1.ID", "table1.name", "table2.ID", "table2.name", ...
The following SQL statement has a syntax error according to phpMyAdmin, but I can't spot what it is. Any ideas?
CREATE TABLE allocations(
`student_uid` INT unsigned NOT NULL DEFAULT 0,
`active` INT unsigned NOT NULL DEFAULT 1,
`name` VARCHAR( 255 ) NOT NULL DEFAULT '',
`internal_id` VARCHAR( 255 ) DEFAULT '',
`tutor_uid` INT NOT NULL DEFAULT 0,
`allocater_uid` INT unsigned NOT NULL DEFAULT 0,
`time_created` INT NOT NULL DEFAULT 0,
`remote_time` FLOAT NOT NULL DEFAULT 0,
`next_lesson` VARCHAR NOT NULL DEFAULT -1,
PRIMARY KEY ( student_uid )
);
Hi,
I want to translate LINQ expression tree to SQL statement and I don't want to write my own code for this.
Example:
var query = from c in Customers
where c.Country == "UK" &&
c.City == "London"
select c);
To
SELECT ... FROM Customers AS c WHERE c.Country = "UK" AND c.City = "London"
I know DataContext.Log, but I want to use:
query.ToSqlStatementString()
Thanks
Hi eveybody, if i have a yield return in a lock statement does the lock get taken out on each yield (5 times in the example below) or only once for all the items in the list?
Thanks
private List<string> _data = new List<string>(){"1","2","3","4","5"};
private object _locker =new object();
public IEnumerable<string> GetData()
{
lock (_locker)
{
foreach (string s in _data)
{
yield return s;
}
}
}
Hi
I am creating a stored procedure to which i want to pass as variable a comma delimited list of Ids
I want to use the Ids into a select statement
something like
Create Procedure up_TEST
@Ids VARCHAR(MAX)
AS
SELECT * FROM ATable a
WHERE a.Id IN(@Ids)
Obviously i get the error that @Ids is a varchar and not an INT but how can i convert the comma delimited list
I am using SQL Server 2008
Thanks
Hi there, I have a query that looks like this:
mysql_query("IF EXISTS(SELECT * FROM predict WHERE uid=$i AND bid=$j)
THEN UPDATE predict SET predict_tfidf=$predict_tfidf WHERE uid=$i AND bid=$j
ELSE INSERT INTO predict (uid, bid, predict_tfidf) VALUES('$i','$j','$predict_tfidf')
END IF")or die(mysql_error());
But it dies and mysql tells me to check the syntax near IF EXISTS(....)
Can we not use an IF statement to start a mysql query?
Thank you in advance.
I have 10 rows for today's date but my select statement based on date dosen't seem to work....
SELECT Id,WirelessId,RegNo,DriverName1,MobileNo1,DriverName2,MobileNo1 from
DailySchedule where IsDeleted=0 and CreatedDate='2010-05-28'
Any suggestion...
Is it possible to skip a statement in Eclipse while debugging? Suppose the process stopped at breakpoint and I want to skip the breakpoint line ( or maybe a few lines below), can I do it? On the debug tab, it only has "Step into", "Step over" and "Step return" buttons.
I did google around but couldn't find anything, hopefully I can find an answer here.
I have a webapplication linked to a mysql database with the following fields:
field 1:trip_id
field 2:trip_destination
field 3:trip_description
field 4:trip_duration
In the webapplication I have a listbox based on the following:
ListBox value =1: trip duration 1 - 5 days
ListBox value =2: trip duration 6 - 10 days
Listbox value =3: trip duration 11 -20 days
ListBox value =4: trip duration over 20 days
How do I put this in the sql select statement?
Can any one please let me know the best way to use IF statement in mysql query to show if the "email" field is NULL then it should show as "no email"...
Postcode Telephone Email
----------------------------------------------------------
BS20 0QN 1275373088 no email
BS20 0QN 1275373088 no email
PO9 4HG 023 92474208 [email protected]
SO43 7DS 07801 715200 [email protected]
----------------------------------------------------------
Hi,
I want to develop a function in PHP that checks how dangerous a SQL statement is. When i say dangerous i mean, certain symbols, characters or strings that are used to get data from a database that the user shouldnt see.
For example:
SELECT * FROM users WHERE userId = '1'
can be injected in several ways. Although i clean the params, i also want to monitor how safe the query is to run.
Thanks in advance
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.
Is there an analogous form of the following code:
if(month == 4,6,9,11)
{
do something;
}
Or must it be:
if(month == 4 || month == 6 etc...)
{
do something;
}
I am trying to write an if statement that checks if this month has more than 31 days.
All are from this post.
What does these statement mean:
error(nargchk(5, 6, nargin));
plot(p(:,1), p(:,2), '.-'), axis equal
And what's this kinda syntax which I haven't quite often seen:
if nargin<6, steps = 36; end
Is there a way to auto complete a statement in eclipse? If I type
if (condition)
it should, after pressing some key, become
if (condition) {
// putting cursor here
}
I always use If statement (In C#) as (1. Alternative);
if (IsSuccessed == true)
{
//
}
I know that there is no need to write "== true" as (2. Alternative));
if (IsSuccessed)
{
//
}
But, I use it because it is more readable and cause no performance issue. Of course, this is my choice and I know many software developers prefer first alternative. What is the best usage, and Why?
I have CMS table that contain CMS_STARTTIME and CMS_STOPTIME (attachment).
I want to create report to summarize exist data by using Date, Time and Year as Parameter (attachment).
I don't know how to create sql statement to meet this requirement. I'm using MySQL and MS-SQL.
Does one can help?
Thank you very much.
ISNULL(SUM(MyTable.Total), 0) AS Total
how can i modify the above statement to also check if Total is less than 0 (zero), such that if Total is NULL or less than 0 (negative), i assign 0 to Total
Can any one please share their experience on
"When do we make a call to use between Synchronised statement and Synchronised Block"
Any Performance Issues?
Hi,
In javascript, how can I test 2 "sets" of conditions in one if statement? example:
if ((a == 'someValue' && b == 'someValue') || (c == 'someValue' && d == 'someValue')) {
// do something
}
Thanks!
Hello,
I need help with select statement in MSSQL.
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.
Thanks in advance
I know its supposed to improve performance and clean strings, but lets say there are no variables?
Might just be a
SELECT COUNT( `column` ) AS count FROM `table`
Should that be prepared?
Is there any case that a SELECT statement should not be prepared?