Archive for the ‘select statement’ Category

How do I find the select statement of an old View in Oracle?

March 25, 2010 - 8:09 am 1 Comment

I’m new to Oracle and working in SQL plus. There are several old views that were created before my time. How could I read the SQL statements for those VIEWs? I tried the following….

select * from all_views where name=’permit_issued’

Try out

dba_views or user_views

you will get the statement in these views

What does the distinct modifier for the select statement do?

March 21, 2010 - 9:39 am 3 Comments

SQL query

That eliminates duplicates in the resultset based on that column.

Select the most correct statement concerning skin cancer.?

March 19, 2010 - 11:19 am 2 Comments

Select the most correct statement concerning skin cancer.

A. Most tumors that arise on the skin are malignant.
B. Squamous cell carcinomas arise from the stratum corneum.
C. Basal cell carcinomas are the least common but most malignant.
D. Melanomas are rare but highly metastasized.

c

sql select statement today’s date - 20 days?

February 15, 2010 - 4:12 am 3 Comments

Hi,

I want to use the SELECT statement to get all my records from my table which is 20 days from the current date. I have been trying all ways but can’t get it.. help will be appreciated!

SELECT WEIGHT, TIME, USER_ID
FROM dbo.WeightTable
WHERE (USR_ID = ‘abc’) AND ….(what to put here)

i am using ms sql server management studio express.. 2005 version. thanks!

SELECT WEIGHT, TIME, USER_ID
FROM dbo.WeightTable
WHERE (USR_ID = ‘abc’)
AND time > dateadd(day, -20, getDate())

How can i create a variable in SSIS that capture information from a Select statement?

January 23, 2010 - 9:49 am 1 Comment

I want to be able to use that variable on the same package in an expression to validate and move to the next step.
So 2 questions:
how to i set a variable from a sql statement?
how to i use a variable as an expression in a constraint?
Thanks you for your help

I haven’t worked with SSIS myself, but take a look at this and see if it answers your questions: http://msdn.microsoft.com/en-us/library/ms140216.aspx

loop of select statement in PHP?

December 27, 2009 - 8:44 am 1 Comment

I have a form with multiple select statements ( 10 select statements)

how can i post the selection of each statement ?

EX:
select city :
select school :
select color :
.
.
.
etc
No i mean <select >
i think it’s called drop down menu

select? you mean like select in mysql?..

How do you write a Select statement that returns all rows in a SQL statement?

December 24, 2009 - 9:51 pm 2 Comments

SQL Oracle

About as simple as it gets:

SELECT * FROM someTable;

Note that doing SELECT * is generally considered bad programming practice…most of the time, you really don’t need every single column of the table, so you’re just needlessly using system resources to retrieve stuff you don’t want anyway.

How do I insert multiple rows in MySQL using nested select statements?

November 17, 2009 - 10:29 pm 3 Comments

e.g. insert into lmms.household (id,family_name,location_id,last_update_time,last_update_user_id,creation_time,creation_user_id) values
((select households_id from world.households),(select family_name from world.households),"93469603",(select last_updated from world.households),"1",(select created_date from world.households),"1");
returns an error- "subquery returns more than one row"?
How can this statement be re-written?

select households_id from world.households
select family_name from world.households
select last_updated from world.households

those statements need to be 1 row.
just put a conditional like where whatever = whatever

What is a select case statement in Visual Basic?

November 14, 2009 - 10:48 pm 1 Comment

How is it the same and different as an if/else if statement?

If statements are designed to select one of two branches. While that can be chained to select from more than two branches, it gets complex and hard to read. The select statement chooses from numerous branches.

If calculates the value of a logical expression. This logical expression may be very complex, but will evaluate to true or false.

Select calculates the value of an expression and then compares the result with a set of constants. The matching constant selects the branch to use.

If you have to select one of many branches it’s more efficient to use the select statement. It’s also much easier to read. If you have multiple options it’s better to express that directly rather than chaining if statements.

Writing code that is easy to understand is very important. Everything you can do to make the intention clearer is worthwhile.

The system can often use smarter comparisons rather than something like "is it 1? no. Is it 2? no. Is it 3? no …"

select the correct statement regarding age-related blood disorders:?

November 5, 2009 - 11:12 pm 1 Comment

a. they are usually the result of the red blood cells wearing out
b. increased incidence of leukemia is not usually associated with aging
c. they include anemias and thromboembolytic disorders
d. they are caused by abnormal forms of hemoglobin f.

c. The others are incorrect.