select

How do I write this database comparison in Oracle PL/SQL?

Given databases x, y with matching schemas: //for all entries in x.MY_TABLE // if PRIMARY_KEY of entry exists in y.MY_TABLE // if {data of entry in x} doesn't match {data of matching entry in y} // print PRIMARY_KEY // else // print PRIMARY_KEY Assume that the table is a simple system...

Setting a variable with select inside coalesce

How do I fix up this part of my stored procedure? The select will either return 1, 0, or null. If the select returns 1 or 0, I want @override to be set to that value. If it returns null, then I want @override to be set to 1. Something is wrong with my syntax; I am told "incorrect syntax near 'select'" and "incorrect sytax near ')'". ...

select selected option using jquery to show specific result

Using jquery, how do i tell which select option is selected, and "show" a single corresponding hidden div? <select id="mySelect"> <option value="1">First</option> <option value="2">Second</option> <option value="3">Third</option> </select> <label for="name">Name</label> <input id="name" type="text" /> <button id="search">search</butto...

Show field if certain option value is selected - must work on pageload

This genius code works fine for checkboxes: $(document).ready(function() { $("#Languages-spoken-and-understood-8").change(function() { $("#li-2-21")[$(this).is(":checked") ? 'show' : 'hide']("fast") }).change(); }); What I love about is that it works onload. I was trying to modify it for a select box. Code is autogenerated...

Sql query on rownum

SELECT instmax FROM (SELECT instmax ,rownum r FROM ( SELECT instmax FROM pswlinstmax ORDER BY instmax DESC NULLS LAST ) WHERE r = 2 ); After execution it's giving this error: ORA-00904: "R": invalid identifier 00904. 00000 - "%s: invalid identifier" *Cause: *Action: Error at Line: 39 Column: 8 why it's giving th...

SQL Select Statement with WHERE, AND, OR

Hi guys, I would like to perform a SELECT query with MySQL. My goal is to select all the dogs in a vet database that would be sex=male and fur=short and (color=black or size=big) Note: I want to select dogs that are either black or size are big. They don't have to fulfill the 2 requirements. They just need to fulfill either one. I have...

why there's a difference of performance gain among both these queries?

SELECT instmax, r FROM (SELECT instmax, rownum r FROM ( SELECT instmax FROM pswlinstmax ORDER BY instmax DESC NULLS LAST ) WHERE rownum <= 10 ) WHERE r >=6; Output SELECT instmax, r FROM (SELECT instmax, rownum r FROM ( SELECT instmax FROM psw...

how to insert some formula in mysql?

i want to calculating one row at table "counter". i try to make my table like: name black yellow white qty_job total david 1 0 0 2 ? andrew 0 1 1 4 ? the formula to calculate is : total = (nblack * 1) + (nyel...

Insert and select from a table/array in oracle

Hi everyone, I have a pretty big sql statement which returns a list of id's. I need this id-list as base for other statements. Like this: open crs_result1 for ' select * from ... where id in ( select <ids> from <base_statement> ) '; open crs_result2 for ' select * from ... where id in ( select <ids> from <base_statement> ) '; open crs_...

JQuery change function based on if the 'select' is more or less than a given value.

Hi All, This seems to be defeating me at the moment but I don't think I can be a million miles away. Basically I have a Age Verification form which just shows the year unless it's the year in which the day month would also affect the user meeting the age restriction, (in this case 1992 for 18) - in which case the day/month selects wo...

Javacript hide additional text field in existing script

I am using this code: http://jsfiddle.net/q3nUS/ $('#cf11_field_20').change(function() { $("#li-11-22")[$(this).val() == "full03_accommodation_hotel" ? 'show' : 'hide']("fast"); }).change(); $('#cf11_field_22').change(function() { $("#li-11-23")[$(this).val() == "full03_hotel_other" ? 'show' : 'hide']("fast"); }).change(); It wor...

Subsonic help, how to list only the first record

Hi I'm doing a little report using subsonic I'm pretty noob And I can't figure how to list only the first record in my report I'm doing something like: new Select("id,Name,place,group").From(User.Schema) .InnerJoin(Profile.Schema) .InnerJoin(userGroup.Schema) ...

MySQL - select multiple maximum values

I have a table called order which contains columns id, user_id, price and item_id. Item prices aren't fixed and I would like to select each item's most expensive order. I want to select user_id, item_id and price in the same query. I tried the following query but it doesn't return the correct result set. SELECT user_id, item_id, MAX(pri...

Using select to switch images

I'm fairly new to jQuery and I am trying to switch image src attribute by getting the links from a select HTML tag. This is the select HTML that I'm using: <select id="pages"> <option value="Manga/Naruto/Friends/01.png">1</option> <option value="Manga/Naruto/Friends/02.png">2</option> <option value="Manga/Naruto/Friends/03.png"...

mysql select query

My question is very simple, but I can't seem to find the answer on here. So, All I want to do is select from two tables at once (with identical column names[id]) I currently have "SELECT * FROM table1 WHERE id='$id_var'" but I also need to check 'table2' aswell. What's the best way to do this without creating a second query? th...

Pros / Cons of MySql JOINS

This is a question that has bugged more for a few weeks now and I haven't got around to asking it to you guys. When I'm selecting data from multiple tables I used to use JOINS a lot and recently I started to use another way but I'm unsure of the impact in the long run. Examples: SELECT * FROM table_1 LEFT JOIN table_2 ON (table_1.colu...

Using ruby "build" dynamically with jQuery in rails

Hi, Got a rails application that has a form (new action) with a select with an options value range from 1 to 5. When the users selects one of the options I need to use ruby "build" to build a number of objects depending on what the select value is. So when the user selects 2 in the select box the following code needs to run: @rooms = ...

Using one struts 2 tag inside another

Hi All, I have a struts 2 select element to select the mumber of results to be diplayed per page. I set the selected value in a session variable. On the JSP page I want the user selected value to be preselected in the select element. If I hard cord the value it works like this <s:select name="fetchSize" cssClass="textCopmanyPropValue" ...

How to implement Bounding Box(Multiple selection of objects) and grouping as implemented in Photoshop using WPF( using SVG/PVG) /Winforms?

Hello Everybody, I am working on WPF with SVG,PVG(these are the format used ofr WPF, not using XAML) for a Publishing application. I want to implement the multiselect of different objects and scaling to them and also grouping them and implementing rotating and moving and sacling the objects as group . I want the exact/some pont near to...

MySQL Custom Order

Hello! I have a table that I select data from with a column called parent that's of unsigned integer type. It has numbers from 0 to 12. I want to select * from table order by parent asc, but with one exception: place the 0 at the end of the select so it would be like 1,2,3,4,5,6,7,8,9,0. Is this possible with a single select in MySQL...