Questions tagged [inner-query]

79 questions
0
votes
2 answers

Getting SQL results with inner query

I am having a problem with a SQL query: select o.orderID,c.city from `order` o, `customer` c, `ordered_items` oi where o.FKCustomerID = c.customerID and o.orderStatus = 'IN PROGRESS' and o.orderID = oi.FKOrderID and…
chathura
  • 3,362
  • 6
  • 41
  • 68
0
votes
1 answer

How to implement sub-query in Microstratergy?

Please give me guidance on how to implement the following query in Microstratergy. SELECT batch_nr,check_nr,update_ts FROM claim_financial_transaction_dim a, (select max(update_ts) update_ts,check_nr,batch_nr from…
0
votes
1 answer

Does Vertica DBD takes Inner Queries into account while configuring Projections?

I created COMPREHENSIVE design using a list of 80-85 Queries. Most of them are too big , like 300 - 400 lines each . And most of the Queries has a lot of inner Queries . My Query is that does DBD takes into account the inner Queries too for…
minatverma
  • 1,090
  • 13
  • 24
0
votes
1 answer

Count rows based on multiple columns

So basically there are two tables. First is location table - id location_id city_name country_name 1 400212 Paris Canada 2 400122 Paris France 2 400122 Dubai United Arab Emirates Second is general_details table - id…
Anoop
  • 173
  • 1
  • 1
  • 14
0
votes
0 answers

Truncate decimal for MySql Command

I want to use Truncate command with Select * query . I am thinking if something like a nested query is applicable just to determine if the returned column is a decimal value or not and apply truncate (2 decimal point) to it. A random version would…
Being Coder
  • 127
  • 2
  • 10
0
votes
1 answer

Sql Server FOR XML EXPLICIT with inner queries

I have the following query which produces XML output: select Top 10 1 as tag, null as parent, property_name as [Property!1!PropertyName!cdata], (select 2 as tag, 1 as parent, null as…
0
votes
2 answers

Order by in subquery (for jQuery jTable) doesn't work?

Some background: My framework jQuery jTable, allows me to do pagination and sort columns, in my select query I need to retrieve n rows (from nth, to nth) and previously order the data by the selected column. I have a table with n columns where would…
Erick Asto Oblitas
  • 1,399
  • 3
  • 21
  • 47
0
votes
1 answer

Join table with inner-query-table

Please have a look at this SQL fiddle with this select statement: select T1.VAL, ttemp.* from T1, (select rownum, t.* from (select * from T2 where t2.val = t1.val ) t) ttemp where t1.val = ttemp.val and t1.val > 2 Here I want to join the outer…
bjan
  • 2,000
  • 7
  • 32
  • 64
0
votes
2 answers

Oracle PL/SQL: referencing to a column name in inner joined query

I have the following SQL statement: SELECT * FROM cars car LEFT JOIN (SELECT * FROM cars auto LEFT JOIN steeringwheels sw ON auto.steeringwheelid = sw.ID …
simon
  • 12,666
  • 26
  • 78
  • 113
0
votes
2 answers

IN operator with Inner query SQL

I have this query SELECT * FROM `posts` WHERE `language` IN ( SELECT `possible_languages` FROM `users` WHERE user_id = ? ); In the table posts: languages can be either en or ar In the table users: possible_languages can be either 'en', 'ar' or…
Jad Joubran
  • 2,511
  • 3
  • 31
  • 57
0
votes
0 answers

Take the result of a MySQL query and put in another query

7I have a table named "Critères" Critères have two columns: "Prestation / Code hors projet" - "Heures" Salut 20 Salut 42 Salut 35 Coco 152 Coco …
Noude
  • 57
  • 6
0
votes
1 answer

MYSQL query with complex aggregated results

Here is the scenario. I've got two tables with schema like this experience: (id, title) user_experience: (id, experience_id, created_date) When a user adds an experience to his to do list, a record is added in user_experience. Now I want to get the…
Adee
  • 464
  • 6
  • 17
0
votes
2 answers

How to make these queries to subqueries?

How to make this into a single query. I have formulated the following query: $msgs=mysql_query("select m.subject, m.msg from message as m, message_users as mu where m.id=mu.msg_id and mu.user_id=$u_id order by dateof_msg…
AndRaGhu
  • 161
  • 7
  • 17
0
votes
2 answers

How to specify a dummy column in outer queries using MySQL?

I need to perform the following query: SELECT ID FROM tbl_a WHERE (fld_merchID, 'something') IN (SELECT MerchID, MAX(Priority) FROM tbl_b WHERE Name LIKE 'AAA.com') as you can image, there's no 'Priority' field in tbl_a. (I need to select the…
content01
  • 3,115
  • 6
  • 41
  • 61
0
votes
3 answers

Inner queries in LINQ

I have the folowing SQL query: Select * from aspnet_Users where UserId Not in (select UN.ConnectedToUserID from tblUserNetwork UN ) and UserId <> '82522f05-2650-466a-a430-72e6c9fb68b7' What will be the LINQ equivalent to this SQL. Thanks
Waheed
  • 10,086
  • 20
  • 53
  • 66