473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

SQL Subquery and alias for datagrid use

I'm going to be using an sql column's content in one datagrid column,
and use another datagrid column for another portion of that sql column

select tbldeal.ID, tblDeal.Sale_Type_ID(select tblDeal.Sale_Type_ID < 3
as News) from tblDeal where thedate = '7/6/2005'

is giving me an error: Incorrect syntax near the keyword 'select'.
I need to display all the salestypeIDs that are under 3 in my datagrid
column named "News".
????
..netSports

Nov 19 '05 #1
2 1136

SELECT tbldeal.ID, tblDeal.Seal_Type_ID AS News
FROM tblDeal
WHERE thedate = '7/6/2005' AND Sale_Type_ID < 3

Not sure if I read your post right, is that what you're looking for?

Tom

Nov 19 '05 #2
your sql is incorrect.
Please change to:
select tbldeal.ID, tblDeal.Sale_Type_ID as News from tblDeal where thedate =
'7/6/2005' and tblDeal.Sale_Type_ID < 3

--
Help you,Help me.
".Net Sports" wrote:
I'm going to be using an sql column's content in one datagrid column,
and use another datagrid column for another portion of that sql column

select tbldeal.ID, tblDeal.Sale_Type_ID(select tblDeal.Sale_Type_ID < 3
as News) from tblDeal where thedate = '7/6/2005'

is giving me an error: Incorrect syntax near the keyword 'select'.
I need to display all the salestypeIDs that are under 3 in my datagrid
column named "News".
????
..netSports

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Joel Goldstick | last post by:
What is wrong with this? IT gives this error: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near...
3
by: Evgeny Gopengauz | last post by:
Let us suppose that we have a table: CREATE TABLE transactions( currencyID_1 int, value_1 money, currencyID_2 int, value_2 money )
2
by: MarekD | last post by:
Hi. I'm new in SqlServer programing. Is it possible to do something like this ( It is common construction in oracle ) Select X from( select a+1 as X from tab1 ) without creating view...
3
by: olanorm | last post by:
I have a query where one or more of the columns returned is a result from a subquery. These columns get their own alias. I want to filter out the rows containing NULL from the subqueries but it...
8
by: Neeper | last post by:
I'm trying to pull the last 10 records from a transactions from a table using this query: SELECT * FROM transactions ORDER BY timestamp DESC LIMIT 10 But I want to display the rows in...
2
by: Tarren | last post by:
Hi: I am not sure what the code would be to achieve this. I am looking for a way to give an alias to an object, so I can assign values to the object regardless of the name. What is the way...
3
by: CSN | last post by:
I'm trying to do: update nodes n1 set n1.parent_id=(select n2.id from nodes n2 where n2.key=n1.parent_id); To set parent_id to the id of the parent (rather than the key). Would UPDATE FROM...
6
by: phillip.s.powell | last post by:
update student s set school_year_id = (select distinct s.id from school_year s, interns i where lower(s.school_year_name) = lower(i.enrollment_year)and s.unique_key = i.unique_key group by s.id);...
5
by: No bother | last post by:
I am using 5.0.26-NT on Windows 2000. I have need to use a reference in the outer from clause in a subquery in the select clause. Consider the following example: Select (select b.baitID from...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.